海康口门门禁

hyx_2024-9-29_tongbu
fangjiakai 2024-09-05 10:26:34 +08:00
parent 39ec65ad0b
commit bd2a4144d2
25 changed files with 4721 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
src/assets/images/map/c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/images/map/h.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/assets/images/map/l.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,535 @@
<template>
<div class="app-container">
<el-form label-width="100px">
<el-row>
<el-col :span="6">
<el-form-item label="关键字搜索">
<el-input v-model="KEYWORDS" placeholder="搜索摄像头名称"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="name" label="视频名称" />
<el-table-column prop="regionName" label="公司" />
<el-table-column prop="regionPathName" label="区域" />
<el-table-column prop="POSITION" label="状态" width="100">
<template slot-scope="{row}">
<span v-if="row.LATITUDE && row.LONGITUDE"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="500px">
<template slot-scope="{row}">
<el-button v-show="!row.PLATFORMDOORVIDEO_ID" type="success" icon="el-icon-edit" size="mini" @click="handleIn(row)"></el-button>
<el-button v-show="row.PLATFORMDOORVIDEO_ID" type="warning" size="mini" style="margin: 0;" @click="getOutsourced(row)"></el-button>
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="showVideo(row)"></el-button>
<el-button type="warning" size="mini" @click="getRTSP(row)">rtsp</el-button>
<el-button type="info" icon="el-icon-location-information" size="mini" @click="handleMap(row)"></el-button>
<el-button v-show="row.LATITUDE && row.LONGITUDE" type="danger" icon="el-icon-delete" size="mini" @click="handleDel(row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog v-if="dialogVideoHLS" :visible.sync="dialogVideoHLS" :before-close="handleBack" title="视频" width="600px">
<div id="aLiVideoPlayer" class="prism-player"/>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormMap" title="定位" width="1050px" class="dy-dialog">
<el-form ref="form" :model="form" :rules="rules">
<el-form-item label="所属企业" prop="CORPINFO_ID">
<el-select v-model="form.CORPINFO_ID" placeholder="请选择申请状态" clearable >
<el-option v-for="item in corpList" :key="item.CORPINFO_ID" :label="item.CORP_NAME" :value="item.CORPINFO_ID" />
</el-select>
</el-form-item>
<el-form-item>
<div id="map" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<span>经度</span>
<el-input v-model="form.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<span>纬度</span>
<el-input v-model="form.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<el-button @click="dialogFormMap = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
<!-- 反查重点工程 -->
<el-dialog
:visible.sync="outsourcedListVisible"
:title="'绑定列表'"
width="80%">
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="outsourcedList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="OUTSOURCED_NAME" label="重点工程名称" show-overflow-tooltip />
<el-table-column prop="STATE" label="状态" width="100" >
<template slot-scope="{row}">
<span v-if="row.STATE == 0"></span>
<span v-if="row.STATE == 1"></span>
<span v-if="row.STATE == 2"></span>
<span v-if="row.STATE == -1"></span>
<span v-if="row.STATE == -2"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="400">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="untie(row.VIDEOMANAGER_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="outsourcedListVisible = false"> </el-button>
</div>
</el-dialog>
<!-- 反查重点工程END -->
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import TiandiMap from '../../../components/TianMap/TiandiMap'
export default {
components: { Pagination, TiandiMap },
directives: { waves },
data() {
// eslint-disable-next-line no-unused-vars
return {
map: null,
marker: null,
BMap: '',
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
outsourcedListVisible: false, //
controlRowTemp: null, // row
outsourcedList: [], //
total: 0,
KEYWORDS: '',
tempList: [],
varList: [],
dialogVideoHLS: false,
player: {},
dialogFormMap: false,
corpList: [],
form: {},
rules: {
CORPINFO_ID: [
{ required: true, message: '请选择企业', trigger: 'blur' }
]
}
}
},
async created() {
this.getCorpList()
await this.getAllList()
this.getList()
},
methods: {
getRowKey(row) {
return row.PERSONNELMANAGEMENT_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.listQuery.page = 1
this.getList()
},
goKeyReset() {
this.KEYWORDS = ''
this.getQuery()
},
getCorpList() {
requestFN(
'/corpinfo/listAll',
{}
).then((data) => {
this.corpList = data.varList
}).catch((e) => {
})
},
getAllList() {
return new Promise(resolve => {
requestFN(
'/platform/door/video/listAll',
{ }
).then((data) => {
this.tempList = data.varList
resolve()
}).catch((e) => {
})
})
},
//
getList() {
this.listLoading = true
requestFN(
'/platform/door/video/platformList',
{
'pageNo': this.listQuery.page,
'pageSize': this.listQuery.limit,
'name': this.KEYWORDS
}
).then((res) => {
this.listLoading = false
const tempList = res.data.list
tempList.forEach(item => {
for (let i = 0; i < this.tempList.length; i++) {
if (item.indexCode === this.tempList[i].INDEXCODE) {
console.log(item.indexCode === this.tempList[i].INDEXCODE)
item.PLATFORMDOORVIDEO_ID = this.tempList[i].PLATFORMDOORVIDEO_ID
item.LONGITUDE = this.tempList[i].LONGITUDE
item.LATITUDE = this.tempList[i].LATITUDE
item.CORPINFO_ID = this.tempList[i].CORPINFO_ID
}
}
})
this.varList = tempList
console.log(tempList)
this.total = res.data.total
}).catch((e) => {
this.listLoading = false
})
},
handleIn(row) {
this.$confirm('确认将[' + row.name + ']加入系统吗', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/platform/door/video/add',
{
INDEXCODE: row.indexCode,
REGIONINDEXCODE: row.regionIndexCode,
EXTERNALINDEXCODE: row.externalIndexCode,
NAME: row.name,
CAMERATYPE: row.cameraType,
CASCADECODE: row.cascadeCode,
DECODETAG: row.decodeTag,
RESOURCETYPE: row.resourceType,
CREATETIME: row.createTime,
UPDATETIME: row.updateTime,
SORT: row.sort,
DISORDER: row.disOrder,
RECORDLOCATION: row.recordLocation,
CASCADETYPE: row.cascadeType,
REGIONNAME: row.regionName,
REGIONPATH: row.regionPath,
REGIONPATHNAM: row.regionPathName
}
).then(async() => {
this.$message({
message: '加入成功',
type: 'success'
})
this.listLoading = false
this.allCodes.push(row.indexCode)
this.varList = []
await this.getAllList()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
setPosition() {
this.$refs.form.validate(valid => {
if (valid) {
this.dialogFormMap = false
this.listLoading = true
requestFN(
'/platform/door/video/savePosition',
this.form
).then(async(data) => {
await this.getAllList()
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
//
showVideo(row) {
requestFN(
'/platform/door/video/getHlsPath',
{
INDEXCODE: row.indexCode
}
).then((res) => {
this.dialogVideoHLS = true
this.$nextTick(() => {
// eslint-disable-next-line no-undef
this.player = new Aliplayer({
'id': 'aLiVideoPlayer',
'source': res.data.url,
'width': '100%',
'height': '500px',
'autoplay': true,
'isLive': true,
'rePlay': false,
'playsinline': true,
'preload': true,
'controlBarVisibility': 'hover',
'useH5Prism': true
}, function(player) {
console.log('The player is created')
})
})
}).catch((e) => {
})
},
getRTSP(row) {
requestFN(
'/platform/door/video/getRtspPath',
{
INDEXCODE: row.indexCode
}
).then((res) => {
this.notify(res.data.url)
}).catch((e) => {
this.listLoading = false
})
},
handleDel(row) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/platform/door/video/delLocation',
{
PLATFORMDOORVIDEO_ID: row.PLATFORMDOORVIDEO_ID
}
).then(async(res) => {
// this.dialogVideoHLS = true
this.getList()
await this.getAllList()
}).catch((e) => {
})
}).catch(() => {
})
},
handleMap(row) {
this.dialogFormMap = true
this.form = {
PLATFORMDOORVIDEO_ID: row.PLATFORMDOORVIDEO_ID,
CORPINFO_ID: row.CORPINFO_ID,
INDEXCODE: row.indexCode,
REGIONINDEXCODE: row.regionIndexCode,
EXTERNALINDEXCODE: row.externalIndexCode,
NAME: row.name,
LONGITUDE: row.LONGITUDE,
LATITUDE: row.LATITUDE,
CAMERATYPE: row.cameraType,
CASCADECODE: row.cascadeCode,
DECODETAG: row.decodeTag,
RESOURCETYPE: row.resourceType,
CREATETIME: row.createTime,
UPDATETIME: row.updateTime,
SORT: row.sort,
DISORDER: row.disOrder,
RECORDLOCATION: row.recordLocation,
CASCADETYPE: row.cascadeType,
REGIONNAME: row.regionName,
REGIONPATH: row.regionPath,
REGIONPATHNAM: row.regionPathName
}
this.$nextTick(() => {
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
})
},
/**
* 初始化天地图对象
*/
initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
console.log('天地图初始化成功...')
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
this.initTDT().then((T) => {
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
//
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
//
this.map = new window.T.Map('map')
this.initCenter(lng, lat, zoom)
})
},
initCenter(lng, lat, zoom) {
//
if (!this.form.LONGITUDE && !this.form.LATITUDE) {
this.map.centerAndZoom(new window.T.LngLat(119.58, 39.94), zoom)
this.marker && this.map.removeOverLay(this.marker)
} else {
this.map.centerAndZoom(new window.T.LngLat(lng, lat), zoom)
this.marker && this.map.removeOverLay(this.marker)
this.form.LONGITUDE = lng
this.form.LATITUDE = lat
this.marker = new window.T.Marker(new window.T.LngLat(lng, lat))
//
this.map.addOverLay(this.marker)
}
//
this.map.setMapType(window.TMAP_HYBRID_MAP)
//
this.map.enableScrollWheelZoom()
//
this.map.enableInertia()
//
this.map.addEventListener('click', this.MapClick)
},
MapClick(event) {
this.marker && this.map.removeOverLay(this.marker)
this.form.LONGITUDE = event.lnglat.getLng()
this.form.LATITUDE = event.lnglat.getLat()
this.marker = new window.T.Marker(new window.T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()))
//
this.map.addOverLay(this.marker)
},
back() {
this.dialogVideoHLS = false
this.player.dispose()
},
handleBack() {
this.player.dispose()
this.dialogVideoHLS = false
},
//
async getOutsourced(row) {
this.listLoading = true
this.outsourcedListVisible = true
this.controlRowTemp = row
this.outsourcedList = []
requestFN(
`/videoResources/getRelevanceOutsourced?VIDEO_ID=${row.PLATFORMDOORVIDEO_ID}`,
{
}
).then((data) => {
this.listLoading = false
this.outsourcedList = data.varList
}).catch((e) => {
this.listLoading = false
})
},
async untie(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
console.log(this.VIDEOMANAGER_ID)
requestFN(
'/videomanager/delete',
{
VIDEOMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getOutsourced(this.controlRowTemp)
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
}
}
}
</script>
<style>
#map{
width: 1000px;
height: 500px;
}
</style>

View File

@ -0,0 +1,278 @@
<template>
<div class="app-container">
<div class="level-title">
<h1>{{ this.$parent.DEVICE_ID == '' ? "新增" : "修改" }}</h1>
</div>
<div>
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="10">
<el-form-item label="绑定设备:" prop="DEVICE_ID">
<el-select v-model="form.DEVICE_ID" filterable clearable style="width: 100%;" @change="getDockDeviceInfo">
<el-option v-for="item in deviceList" :key="item.DEVICE_ID" :value="item.DEVICE_ID" :label="item.DEVICE_NAME"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button v-if="!form.DEVICE_ID" style="position: relative; left: 10%" type="danger" icon="el-icon-price-tag" size="mini"></el-button>
<el-button v-else-if="form.DEVICE_ID" style="position: relative; left: 10%" type="success" icon="el-icon-price-tag" size="mini" @click="handleOpen()"></el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="进出类型:" prop="TYPE">
<el-select v-model="form.TYPE" filterable clearable style="width: 100%;">
<el-option v-for="item in typeList" :key="item.NAME" :value="item.VALUE" :label="item.NAME"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="ui-foot">
<el-button type="success" @click="confirm"> </el-button>
<el-button plain type="info" @click="goBack"> </el-button>
</div>
<!-- 设备 -->
<el-dialog v-if="dialogDoor" :visible.sync="dialogDoor" title="设备信息" width="600px">
<el-form v-loading="dialogFormVisible" label-width="150px">
<el-row>
<el-col :span="20">
<el-form-item label="设备名称:" prop="DEVICE_NAME">
<el-input v-model="deviceForm.DEVICE_NAME" disabled placeholder="设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="对接设备名称:" prop="DEVICE_NAME">
<el-input v-model="deviceForm.DOCK_DEVICE_NAME" disabled placeholder="设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="所属口门名称:" prop="DOOR_NAME">
<el-input v-model="deviceForm.DOCK_DOOR_NAME" disabled placeholder="所属口门名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="所属通道名称:" prop="PATH_NAME">
<el-input v-model="deviceForm.DOCK_PATH_NAME" disabled placeholder="所属通道名称"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<div style="position: relative; top: 10px">
<el-button @click="dialogDoor = false"> </el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
DEVICE_NAMES: '',
deviceListQuery: {
page: 1,
limit: 20
},
DOOR_TYPE: '',
doorTotal: 0,
deviceList: [],
doorFilterText: '',
dialogDoor: false,
dialogFormVisible: false,
dialogTableVisible: false,
PERSON_CHARGE: '',
DEPARTMENT_ID_OLD: '',
DEVICE_ID: '',
form: {
DEVICE_ID: '',
AREA_ID: '',
TYPE: ''
},
deviceForm: {
DEVICE_ID: '',
DEVICE_NAME: '',
DOCK_DEVICE_NAME: '',
DOCK_DOOR_NAME: '',
DOCK_PATH_NAME: '',
DEVICE_TYPE: ''
},
typeList: [
{ NAME: '入口', VALUE: '0' },
{ NAME: '出口', VALUE: '1' }
],
statusList: [
{ NAME: '正常', VALUE: 0 },
{ NAME: '停用', VALUE: 1 },
{ NAME: '暂时关闭', VALUE: 2 }
],
riskForm: {},
KEYWORDS: '',
rules: {
DEVICE_ID: [{ required: true, message: '请选择设备', trigger: 'blur' }],
TYPE: [{ required: true, message: '请选择进出类型', trigger: 'blur' }]
},
RELATION_ID: '',
formLabelWidth: '120px',
fullscreenLoading: false,
total: 0,
listQuery: {
page: 1,
limit: 20
},
multipleSelection: [],
accidentList: [],
categoryList: [
{ ID: '1', NAME: '人员' },
{ ID: '2', NAME: '车辆' }
],
leaveList: [
{ ID: '1', NAME: '入' },
{ ID: '2', NAME: '出' }
],
IsAdjacentList: [
{ ID: '0', NAME: '否' },
{ ID: '1', NAME: '是' }
]
}
},
watch: {
},
async created() {
this.form.AREA_ID = this.$parent.AREA_ID
this.RELATION_ID = this.$parent.RELATION_ID
console.log(this.RELATION_ID)
if (this.RELATION_ID) {
this.getDataByID()
}
this.DOOR_TYPE = this.$parent.DOOR_TYPE
this.getDeviceList()
},
methods: {
async handleOpen() {
requestFN(
'/mkmjDevice/findById',
{
DEVICE_ID: this.form.DEVICE_ID
}
).then((data) => {
this.listLoading = false
this.deviceForm = data.pd
this.dialogDoor = true
}).catch((e) => {
this.listLoading = false
console.log(e)
})
},
getDockDeviceInfo() {
const deviceList = this.deviceList
for (let i = 0; i < deviceList.length; i++) {
if (deviceList[i].DEVICE_ID == this.form.DEVICE_ID) {
this.deviceForm.DEVICE_ID = deviceList[i].DEVICE_ID
this.deviceForm.DEVICE_NAME = deviceList[i].DEVICE_NAME
this.deviceForm.DOCK_DEVICE_NAME = deviceList[i].DOCK_DEVICE_NAME
this.deviceForm.DOCK_DOOR_NAME = deviceList[i].DOCK_DOOR_NAME
this.deviceForm.DOCK_PATH_NAME = deviceList[i].DOCK_PATH_NAME
this.deviceForm.DEVICE_TYPE = deviceList[i].DEVICE_TYPE == '0' ? '人行闸机' : '车行闸机'
}
}
console.log(this.deviceForm)
},
getDeviceList() {
this.listLoading = true
return new Promise(resolve => {
requestFN(
'/mkmjDevice/listAllForArea',
{
KEYWORDS: this.doorFilterText
}
).then((data) => {
this.listLoading = false
this.deviceList = data.varList
resolve()
}).catch((e) => {
this.listLoading = false
console.log(e)
})
})
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (!this.RELATION_ID) {
this.handleAdd()
} else {
if (valid) {
this.listLoading = true
requestFN(
'/mkmjRelation/edit',
this.form
).then((data) => {
this.$message.success(data.msg)
this.listLoading = false
this.dialogFormEdit = false
this.$parent.activeName = 'DeviceList'
}).catch((e) => {
this.listLoading = false
})
}
}
}
})
},
handleAdd() {
requestFN(
'/mkmjRelation/add',
this.form
).then((data) => {
if (data.msg === '保存成功') {
this.$message.success(data.msg)
this.goBack()
} else {
this.$message.warning(data.msg)
}
}).catch((e) => {
})
},
getDataByID() {
this.listLoading = true
this.dialogFormVisible = true
requestFN(
'/mkmjRelation/goEdit',
{
RELATION_ID: this.RELATION_ID
}
).then((data) => {
this.form = data.pd
this.dialogFormVisible = false
}).catch((e) => {
this.dialogFormVisible = false
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'DeviceList'
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,275 @@
<template>
<div class="app-container">
<div class="level-title">
<h1>{{ this.$parent.AREA_ID == '' ? "新增" : "修改" }}</h1>
</div>
<div>
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="区域名称:" prop="AREA_NAME">
<el-input v-model="form.AREA_NAME" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="10">-->
<!-- <el-form-item label="绑定设备:" prop="DEVICE_IDS">-->
<!-- <el-input v-model="DEVICE_NAMES" disabled placeholder="请选择口门进行绑定"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="2">-->
<!-- <el-button style="position: relative; left: 10%" type="success" icon="el-icon-price-tag" size="mini" @click="handleOpen()"></el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form>
</div>
<div class="ui-foot">
<el-button type="success" @click="confirm"> </el-button>
<el-button plain type="info" @click="goBack"> </el-button>
</div>
<!-- 选择设备-->
<el-dialog v-if="dialogDevice" :visible.sync="dialogDevice" title="设备" width="1500px">
<div class="icons-container">
<el-input
v-model="deviceFilterText"
placeholder="输入设备名称"
style="margin:10px 0;left: 10px;width: 25%"/>
<el-button type="primary" style="position: relative;left: 10px" @click="getdeviceList"></el-button>
<el-container>
<el-main>
<el-table
ref="deviceMultipleTable"
:data="deviceList"
:row-key="getDeviceRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="DEVICE_NAME" label="设备名称" align="center" />
<el-table-column prop="DEVICE_TYPE" label="设备类型" align="center" >
<template slot-scope="{ row }">
{{ row.DEVICE_TYPE == '0' ? '闸机' : '' }}
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
</div>
<div slot="footer" class="dialog-footer">
<div style="position: relative">
<pagination :total="deviceTotal" :page.sync="deviceListQuery.page" :limit.sync="deviceListQuery.limit" @pagination="getdeviceList"/>
</div>
<div style="position: relative; top: 10px">
<el-button @click="dialogDevice = false"> </el-button>
<el-button type="primary" @click="saveDeviceData"> </el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
dialogDevice: false,
dialogFormVisible: false,
dialogTableVisible: false,
deviceListQuery: {
page: 1,
limit: 20
},
deviceFilterText: '',
deviceTotal: 0,
deviceList: [],
PERSON_CHARGE: '',
DEPARTMENT_ID_OLD: '',
DEVICE_NAMES: '',
form: {
AREA_NAME: '',
AREA_ID: '',
DEVICE_IDS: ''
},
riskForm: {},
KEYWORDS: '',
rules: {
AREA_NAME: [{ required: true, message: '区域名称不为空', trigger: 'blur' }]
},
formLabelWidth: '120px',
fullscreenLoading: false,
total: 0,
listQuery: {
page: 1,
limit: 20
},
multipleSelection: [],
accidentList: [],
leaveList: [
{ ID: '1', NAME: '一级' },
{ ID: '2', NAME: '二级' },
{ ID: '3', NAME: '三级' }
]
}
},
watch: {
},
async created() {
await this.getdeviceList()
this.form.AREA_ID = this.$parent.AREA_ID || ''
this.form.DEVICE_IDS = this.$parent.DEVICE_IDS || ''
if (this.form.AREA_ID) {
this.getDataByID()
}
if (this.form.DEVICE_IDS && this.form.DEVICE_IDS !== '') {
this.initDeviceNames()
}
},
methods: {
initDeviceNames() {
console.log(666)
const deviceIdList = this.form.DEVICE_IDS.split(',')
let devicenames = ''
this.deviceList.forEach(item => {
deviceIdList.forEach(i => {
if (item.DEVICE_ID === i) {
console.log(777)
devicenames = devicenames + item.DEVICE_NAME + ','
}
})
})
this.DEVICE_NAMES = devicenames.replace(/,$/, '')
this.$forceUpdate()
},
saveDeviceData() {
console.log('修改2')
const selection = this.$refs.deviceMultipleTable.selection
let deviceIds = ''
let devicenames = ''
for (let i = 0; i < selection.length; i++) {
deviceIds = deviceIds + selection[i].DEVICE_ID + ','
devicenames = devicenames + selection[i].DEVICE_NAME + ','
}
deviceIds = deviceIds.replace(/,$/, '')
devicenames = devicenames.replace(/,$/, '')
this.form.DEVICE_IDS = deviceIds
this.DEVICE_NAMES = devicenames
this.dialogDevice = false
},
getDeviceRowKey(row) {
return row.DEVICE_ID
},
getdeviceList() {
this.listLoading = true
return new Promise(resolve => {
requestFN(
'/mkmjDevice/list?showCount=' + this.deviceListQuery.limit + '&currentPage=' + this.deviceListQuery.page,
{ KEYWORDS: this.deviceFilterText }
).then((data) => {
this.listLoading = false
this.deviceList = data.varList
this.deviceTotal = data.page.totalResult
resolve()
}).catch((e) => {
this.listLoading = false
console.log(e)
})
})
},
async handleOpen() {
console.log('修改1')
this.dialogDevice = true
if (this.form.DEVICE_IDS && this.form.DEVICE_IDS !== '') {
const selectList = this.form.DEVICE_IDS.split(',')
this.$nextTick(() => {
selectList.forEach(data => {
this.$refs.deviceMultipleTable.toggleRowSelection(this.deviceList.find(item => {
return data === item.DEVICE_ID
}), true)
})
})
this.saveDeviceData()
}
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.$parent.AREA_ID == '') {
this.handleAdd()
} else {
if (valid) {
this.listLoading = true
requestFN(
'/doorArea/edit',
this.form
).then((data) => {
if (data.code != 0) {
this.$message.success(data.msg)
this.listLoading = false
this.dialogFormEdit = false
this.goBack()
}
}).catch((e) => {
this.listLoading = false
})
}
}
}
})
},
handleAdd() {
requestFN(
'/doorArea/add',
this.form
).then((data) => {
if (data.msg === '保存成功') {
this.$message.success(data.msg)
this.goBack()
} else {
this.$message.warning(data.msg)
}
}).catch((e) => {
})
},
getDataByID() {
this.listLoading = true
this.dialogFormVisible = true
requestFN(
'/doorArea/goEdit',
{ AREA_ID: this.form.AREA_ID }
).then((data) => {
this.form = data.pd
this.dialogFormVisible = false
}).catch((e) => {
this.dialogFormVisible = false
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,205 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="人名/车牌号" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入名称"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="NAME" label="人员名称/车牌号"/>
<el-table-column prop="STATUS" label="进出类型"/>
<el-table-column prop="TIME" label="进出时间"/>
<el-table-column prop="BAYNAME" label="进出位置"/>
<el-table-column prop="DOORNAME" label="口门名称"/>
</el-table>
<div class="page-btn-group">
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
map: null,
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
dialogFormMap: false,
AREA_ID: '',
AREA_LEAVE: '',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
form: {
PATH_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
ls: [],
dates: [],
DOOR_TYPE: '',
total: 0,
KEYWORDS: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.AREA_ID = this.$parent.AREA_ID
this.getList()
this.hasButton()
},
methods: {
getRowKey(row) {
return row.PATH_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.activeName = 'EditPath'
this.$parent.AREA_ID = this.AREA_ID
this.$parent.PATH_ID = ''
},
handleDevice(row) {
this.$parent.activeName = 'ListDevice'
this.$parent.PATH_ID = row.PATH_ID
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
requestFN(
'/mkmjRelation/getInfoList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
AREA_ID: this.AREA_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
hasButton: function() {
var keys = 'mkmjDoor:add,mkmjDoor:del,mkmjDoor:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjDoorfhadminadd //
this.del = data.mkmjDoorfhadmindel //
this.edit = data.mkmjDoorfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style scoped>
#map{
width: 1000px;
height: 500px;
}
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,356 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="区域名称/编码" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="AREA_NAME" label="区域名称"/>
<el-table-column prop="DEVICE_COUNT" label="设备数量"/>
<el-table-column label="操作" width="480">
<template slot-scope="{row}">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
@click="handleInfoView(row)">查看记录
</el-button>
<el-button
v-show="edit"
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleEdit(row)">编辑
</el-button>
<el-button
v-if="edit"
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row)">删除
</el-button>
<el-button
type="success"
icon="el-icon-price-tag"
size="mini"
@click="handleOpen(row)">绑定设备
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
<!-- 选择口门 -->
<el-dialog v-if="dialogDoor" :visible.sync="dialogDoor" title="口门" width="1500px">
<div class="icons-container">
<el-input
v-model="doorFilterText"
placeholder="输入口门名称"
style="margin:10px 0;left: 10px;width: 25%"/>
<el-button type="primary" style="position: relative;left: 10px" @click="getDeviceList"></el-button>
<el-container>
<el-main>
<el-table
ref="doorMultipleTable"
:data="deviceList"
:row-key="getDoorRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="DEVICE_NAME" label="设备名称" align="center" />
<el-table-column prop="DEVICE_TYPE" label="设备类型" align="center" >
<template slot-scope="{ row }">
{{ row.DEVICE_TYPE == '0' ? '闸机' : '' }}
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
</div>
<div slot="footer" class="dialog-footer">
<div style="position: relative">
<pagination :total="doorTotal" :page.sync="deviceListQuery.page" :limit.sync="deviceListQuery.limit" @pagination="getDeviceList"/>
</div>
<div style="position: relative; top: 10px">
<el-button @click="dialogDoor = false"> </el-button>
<el-button type="primary" @click="saveDoorData"> </el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
deviceList: [],
dialogDoor: false,
AREA_ID: '',
DEVICE_IDS: '',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
deviceListQuery: {
page: 1,
limit: 20
},
ls: [],
dates: [],
total: 0,
doorTotal: 0,
KEYWORDS: '',
doorFilterText: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList()
this.hasButton()
},
methods: {
saveDoorData() {
const selection = this.$refs.doorMultipleTable.selection
let doorIds = ''
for (let i = 0; i < selection.length; i++) {
doorIds = doorIds + selection[i].DOOR_ID + ','
}
doorIds = doorIds.replace(/,$/, '')
this.DEVICE_IDS = doorIds
requestFN(
'/doorArea/edit',
{
AREA_ID: this.AREA_ID,
DEVICE_IDS: doorIds
}
).then((data) => {
if (data.code != 0) {
this.$message.success(data.msg)
this.listLoading = false
this.dialogDoor = false
}
this.getList()
}).catch((e) => {
this.listLoading = false
this.dialogDoor = false
})
},
getDeviceList() {
this.listLoading = true
return new Promise(resolve => {
requestFN(
'/mkmjDevice/list?showCount=' + this.deviceListQuery.limit + '&currentPage=' + this.deviceListQuery.page,
{
KEYWORDS: this.doorFilterText
}
).then((data) => {
this.listLoading = false
this.deviceList = data.varList
this.doorTotal = data.page.totalResult
resolve()
}).catch((e) => {
this.listLoading = false
console.log(e)
})
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
getRowKey(row) {
return row.AREA_ID
},
getDoorRowKey(row) {
return row.DOOR_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.AREA_ID = ''
this.$parent.DEVICE_IDS = ''
this.$parent.activeName = 'Edit'
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
this.HIDDENREGION_ID = pid
requestFN(
'/doorArea/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
handleInfoView(row) {
this.$parent.AREA_ID = row.AREA_ID
this.$parent.activeName = 'infoList'
},
handleEdit(row) {
this.$parent.AREA_ID = row.AREA_ID
this.$parent.DEVICE_IDS = row.DEVICE_IDS
this.$parent.activeName = 'Edit'
},
handleOpen(row) {
this.$parent.AREA_ID = row.AREA_ID
this.$parent.activeName = 'DeviceList'
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/doorArea/delete',
{
AREA_ID: row.AREA_ID
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'mkmjArea:add,mkmjArea:del,mkmjArea:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjAreafhadminadd //
this.del = data.mkmjAreafhadmindel //
this.edit = data.mkmjAreafhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,295 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="设备名称" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入设备名称"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="DEVICE_NAME" label="设备名称"/>
<el-table-column prop="DOCK_DEVICE_NAME" label="对接设备名称"/>
<el-table-column prop="DOCK_DOOR_NAME" label="对接所属口门"/>
<el-table-column prop="DOCK_PATH_NAME" label="对接所属通道"/>
<el-table-column label="进出类型">
<template slot-scope="{row}">
<span v-if="row.TYPE === '0'" >入口</span>
<span v-else-if="row.TYPE === '1'" >出口</span>
</template>
</el-table-column>
<el-table-column label="操作" width="400">
<template slot-scope="{row}">
<el-button
v-show="edit"
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleEdit(row.RELATION_ID)">修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
map: null,
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
dialogFormMap: false,
PATH_ID: '',
AREA_ID: '',
AREA_LEAVE: '',
DOOR_TYPE: '',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
form: {
PATH_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
ls: [],
dates: [],
total: 0,
KEYWORDS: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.PATH_ID = this.$parent.PATH_ID
this.AREA_ID = this.$parent.AREA_ID
this.AREA_LEAVE = this.$parent.AREA_LEAVE
this.DOOR_TYPE = this.$parent.DOOR_TYPE
this.getList()
this.hasButton()
},
methods: {
getRowKey(row) {
return row.PATH_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.activeName = 'EditDevice'
this.$parent.AREA_ID = this.AREA_ID
this.$parent.RELATION_ID = ''
},
handleDevice() {
this.$parent.activeName = 'ListDevice'
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
this.HIDDENREGION_ID = pid
requestFN(
'/doorArea/listForDevice?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
AREA_ID: this.AREA_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
handleEdit(RELATION_ID) {
this.$parent.RELATION_ID = RELATION_ID
this.$parent.activeName = 'EditDevice'
},
handleMap(row) {
this.dialogFormMap = true
this.form = {
PATH_ID: row.PATH_ID,
LATITUDE: row.LATITUDE,
LONGITUDE: row.LONGITUDE
}
this.$nextTick(() => {
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
})
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.DEVICE_NAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjRelation/delete',
{
RELATION_ID: row.RELATION_ID
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
setPosition() {
this.dialogFormMap = false
this.listLoading = true
requestFN(
'/mkmjDevice/savePosition',
{
LATITUDE: this.form.LATITUDE,
LONGITUDE: this.form.LONGITUDE,
PATH_ID: this.form.PATH_ID
}
).then((data) => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'mkmjDoor:add,mkmjDoor:del,mkmjDoor:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjDoorfhadminadd //
this.del = data.mkmjDoorfhadmindel //
this.edit = data.mkmjDoorfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style scoped>
#map{
width: 1000px;
height: 500px;
}
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,37 @@
<template>
<div>
<List v-if="activeName=='List'" ref="list" />
<Edit v-if="activeName=='Edit'" />
<Device-list v-if="activeName=='DeviceList'" />
<Edit-device v-if="activeName=='EditDevice'" />
<info-list v-if="activeName=='infoList'" />
</div>
</template>
<script>
import List from './components/list'
import Edit from './components/edit'
import DeviceList from './components/listDevice'
import EditDevice from './components/EditDevice'
import infoList from './components/infoList'
export default {
components: {
List: List,
Edit: Edit,
DeviceList: DeviceList,
EditDevice: EditDevice,
infoList: infoList
},
data() {
return {
activeName: 'List'
}
},
watch: {}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,295 @@
<template>
<div class="app-container">
<div class="level-title">
<h1>{{ this.$parent.DEVICE_ID == '' ? "新增" : "修改" }}</h1>
</div>
<div>
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="设备名称:" prop="DEVICE_NAME">
<el-input v-model="form.DEVICE_NAME" placeholder="闸机名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备类型:" prop="DEVICE_TYPE">
<el-select v-model="form.DEVICE_TYPE" style="width: 100%;">
<el-option v-for="item in typeList" :key="item.VALUE" :label="item.NAME" :value="item.VALUE" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="绑定设备:" prop="DOCK_DEVICE_ID">
<el-select v-model="form.DOCK_DEVICE_ID" filterable clearable style="width: 100%;" @change="getDockDeviceInfo">
<el-option v-for="item in deviceList" :key="item.DOCK_DEVICE_ID" :value="item.DOCK_DEVICE_ID" :label="item.DEVICE_NAME"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button v-if="!form.DOCK_DEVICE_ID" style="position: relative; left: 10%" type="danger" icon="el-icon-price-tag" size="mini"></el-button>
<el-button v-else-if="form.DOCK_DEVICE_ID" style="position: relative; left: 10%" type="success" icon="el-icon-price-tag" size="mini" @click="handleOpen()"></el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" style="width: 100%;">
<el-option v-for="item in statusList" :key="item.VALUE" :label="item.NAME" :value="item.VALUE" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="ui-foot">
<el-button type="success" @click="confirm"> </el-button>
<el-button plain type="info" @click="goBack"> </el-button>
</div>
<!-- 设备 -->
<el-dialog v-if="dialogDoor" :visible.sync="dialogDoor" title="设备信息" width="600px">
<el-form v-loading="dialogFormVisible" label-width="150px">
<el-row>
<el-col :span="20">
<el-form-item label="设备名称:" prop="DEVICE_NAME">
<el-input v-model="dockDeviceForm.DEVICE_NAME" disabled placeholder="设备名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="所属口门名称:" prop="DOOR_NAME">
<el-input v-model="dockDeviceForm.DOOR_NAME" disabled placeholder="所属口门名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="所属通道名称:" prop="PATH_NAME">
<el-input v-model="dockDeviceForm.PATH_NAME" disabled placeholder="所属通道名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="设备类型:" prop="DEVICE_TYPE">
<el-input v-model="dockDeviceForm.DEVICE_TYPE" disabled placeholder="设备类型"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<div style="position: relative; top: 10px">
<el-button @click="dialogDoor = false"> </el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
DEVICE_NAMES: '',
deviceListQuery: {
page: 1,
limit: 20
},
DOOR_TYPE: '',
doorTotal: 0,
deviceList: [],
doorFilterText: '',
dialogDoor: false,
dialogFormVisible: false,
dialogTableVisible: false,
PERSON_CHARGE: '',
DEPARTMENT_ID_OLD: '',
DEVICE_ID: '',
form: {
DOCK_DEVICE_ID: '',
DEVICE_NAME: '',
DEVICE_TYPE: '',
PATH_ID: '',
DOOR_ID: '',
STATUS: ''
},
dockDeviceForm: {
DOCK_DEVICE_ID: '',
DEVICE_NAME: '',
DOOR_NAME: '',
PATH_NAME: '',
DEVICE_TYPE: ''
},
typeList: [
{ NAME: '闸机', VALUE: 0 }
],
statusList: [
{ NAME: '正常', VALUE: 0 },
{ NAME: '停用', VALUE: 1 },
{ NAME: '暂时关闭', VALUE: 2 }
],
riskForm: {},
KEYWORDS: '',
rules: {
DOCK_DEVICE_ID: [{ required: true, message: '请选择绑定设备', trigger: 'blur' }],
DEVICE_NAME: [{ required: true, message: '闸机名称不为空', trigger: 'blur' }],
DEVICE_TYPE: [{ required: true, message: '闸机类型不为空', trigger: 'blur' }],
STATUS: [{ required: true, message: '闸机类别不为空', trigger: 'blur' }]
},
formLabelWidth: '120px',
fullscreenLoading: false,
total: 0,
listQuery: {
page: 1,
limit: 20
},
multipleSelection: [],
accidentList: [],
categoryList: [
{ ID: '1', NAME: '人员' },
{ ID: '2', NAME: '车辆' }
],
leaveList: [
{ ID: '1', NAME: '入' },
{ ID: '2', NAME: '出' }
],
IsAdjacentList: [
{ ID: '0', NAME: '否' },
{ ID: '1', NAME: '是' }
]
}
},
watch: {
},
async created() {
this.form.PATH_ID = this.$parent.PATH_ID
this.form.DOOR_ID = this.$parent.DOOR_ID
this.DEVICE_ID = this.$parent.DEVICE_ID
if (this.DEVICE_ID) {
this.getDataByID()
}
this.DOOR_TYPE = this.$parent.DOOR_TYPE
this.getDeviceList()
},
methods: {
async handleOpen() {
requestFN(
'/mkmjDockDevice/findById',
{
DOCK_DEVICE_ID: this.form.DOCK_DEVICE_ID
}
).then((data) => {
this.listLoading = false
this.dockDeviceForm = data.pd
this.dialogDoor = true
}).catch((e) => {
this.listLoading = false
console.log(e)
})
},
getDockDeviceInfo() {
const deviceList = this.deviceList
for (let i = 0; i < deviceList.length; i++) {
if (deviceList[i].DOCK_DEVICE_ID == this.form.DOCK_DEVICE_ID) {
this.dockDeviceForm.DOCK_DEVICE_ID = deviceList[i].DOCK_DEVICE_ID
this.dockDeviceForm.DEVICE_NAME = deviceList[i].DEVICE_NAME
this.dockDeviceForm.DOOR_NAME = deviceList[i].DOOR_NAME
this.dockDeviceForm.PATH_NAME = deviceList[i].PATH_NAME
this.dockDeviceForm.DEVICE_TYPE = deviceList[i].DEVICE_TYPE == '0' ? '人行闸机' : '车行闸机'
}
}
console.log(this.dockDeviceForm)
},
getDeviceList() {
this.listLoading = true
return new Promise(resolve => {
requestFN(
'/mkmjDockDevice/listAll',
{
KEYWORDS: this.doorFilterText,
DOOR_TYPE: this.DOOR_TYPE
}
).then((data) => {
this.listLoading = false
this.deviceList = data.varList
this.doorTotal = data.page.totalResult
resolve()
}).catch((e) => {
this.listLoading = false
console.log(e)
})
})
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (!this.DEVICE_ID) {
this.handleAdd()
} else {
if (valid) {
this.listLoading = true
requestFN(
'/mkmjDevice/edit',
this.form
).then((data) => {
this.$message.success(data.msg)
this.listLoading = false
this.dialogFormEdit = false
this.$parent.activeName = 'ListDevice'
}).catch((e) => {
this.listLoading = false
})
}
}
}
})
},
handleAdd() {
requestFN(
'/mkmjDevice/add',
this.form
).then((data) => {
if (data.msg === '保存成功') {
this.$message.success(data.msg)
this.goBack()
} else {
this.$message.warning(data.msg)
}
}).catch((e) => {
})
},
getDataByID() {
this.listLoading = true
this.dialogFormVisible = true
requestFN(
'/mkmjDevice/goEdit',
{ DEVICE_ID: this.DEVICE_ID }
).then((data) => {
this.form = data.pd
this.dialogFormVisible = false
}).catch((e) => {
this.dialogFormVisible = false
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'ListDevice'
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,204 @@
<template>
<div class="app-container">
<div class="level-title">
<h1>{{ this.$parent.PATH_ID == '' ? "新增" : "修改" }}</h1>
</div>
<div>
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="通道名称:" prop="PATH_NAME">
<el-input v-model="form.PATH_NAME" placeholder="闸机名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="通道类型:" prop="PATH_TYPE">
<el-select v-model="form.PATH_TYPE" style="width: 100%;">
<el-option v-for="item in typeList" :key="item.VALUE" :label="item.NAME" :value="item.VALUE" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" style="width: 100%;">
<el-option v-for="item in statusList" :key="item.VALUE" :label="item.NAME" :value="item.VALUE" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="ui-foot">
<el-button type="success" @click="confirm"> </el-button>
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
dialogFormVisible: false,
dialogTableVisible: false,
PERSON_CHARGE: '',
DEPARTMENT_ID_OLD: '',
PATH_ID: '',
form: {
PATH_NAME: '',
PATH_TYPE: '',
STATUS: ''
},
typeList: [
{ NAME: '人行通道', VALUE: 0 },
{ NAME: '车行通道', VALUE: 1 }
],
statusList: [
{ NAME: '正常', VALUE: 0 },
{ NAME: '停用', VALUE: 1 },
{ NAME: '暂时关闭', VALUE: 2 }
],
riskForm: {},
KEYWORDS: '',
rules: {
PATH_NAME: [{ required: true, message: '闸机名称不为空', trigger: 'blur' }],
PATH_TYPE: [{ required: true, message: '闸机类型不为空', trigger: 'blur' }],
STATUS: [{ required: true, message: '闸机类别不为空', trigger: 'blur' }]
},
formLabelWidth: '120px',
fullscreenLoading: false,
total: 0,
listQuery: {
page: 1,
limit: 20
},
AreaList: [],
multipleSelection: [],
accidentList: [],
categoryList: [
{ ID: '1', NAME: '人员' },
{ ID: '2', NAME: '车辆' }
],
leaveList: [
{ ID: '1', NAME: '入' },
{ ID: '2', NAME: '出' }
],
IsAdjacentList: [
{ ID: '0', NAME: '否' },
{ ID: '1', NAME: '是' }
]
}
},
watch: {
},
async created() {
this.form.DOOR_ID = this.$parent.DOOR_ID
this.PATH_ID = this.$parent.PATH_ID
if (this.PATH_ID) {
this.getDataByID()
}
if (this.$parent.DOOR_TYPE == '0') {
this.typeList = [{ NAME: '人行通道', VALUE: 0 }]
} else {
this.typeList = [{ NAME: '车行通道', VALUE: 1 }]
}
this.getList()
},
methods: {
//
getList() {
this.AreaList = []
requestFN(
'/mkmjPath/list?showCount=100&currentPage=1',
{
AREA_PARENT_ID: this.form.AREA_PARENT_ID
}
).then((data) => {
for (var i = 0; i < data.varList.length; i++) {
var item = data.varList[i]
if (item.AREA_ID != this.form.AREA_ID) {
this.AreaList.push(item)
}
}
}).catch((e) => {
})
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (!this.PATH_ID) {
this.handleAdd()
} else {
if (valid) {
this.listLoading = true
requestFN(
'/mkmjPath/edit',
{
...this.form,
CORPINFO_ID: this.$parent.CORPINFO_ID
}
).then((data) => {
this.$message.success(data.msg)
this.listLoading = false
this.dialogFormEdit = false
this.$parent.activeName = 'ListPath'
}).catch((e) => {
this.listLoading = false
})
}
}
}
})
},
handleAdd() {
requestFN(
'/mkmjPath/add',
{
...this.form,
CORPINFO_ID: this.$parent.CORPINFO_ID
}
).then((data) => {
if (data.msg === '保存成功') {
this.$message.success(data.msg)
this.goBack()
} else {
this.$message.warning(data.msg)
}
}).catch((e) => {
})
},
getDataByID() {
this.listLoading = true
this.dialogFormVisible = true
requestFN(
'/mkmjPath/goEdit',
{ PATH_ID: this.PATH_ID }
).then((data) => {
this.form = data.pd
this.dialogFormVisible = false
}).catch((e) => {
this.dialogFormVisible = false
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'ListPath'
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,307 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="设备名称" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入设备名称"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="DEVICE_NAME" label="设备名称"/>
<el-table-column prop="DOCK_DEVICE_NAME" label="对接设备名称"/>
<el-table-column prop="DOCK_DOOR_NAME" label="对接所属口门"/>
<el-table-column prop="DOCK_PATH_NAME" label="对接所属通道"/>
<el-table-column label="对接设备类型">
<template slot-scope="{row}">
<span v-if="row.DOCK_DEVICE_TYPE == '0'" >人行闸机</span>
<span v-else-if="row.DOCK_DEVICE_TYPE == '1'" >车行闸机</span>
</template>
</el-table-column>
<el-table-column label="设备类型">
<template slot-scope="{row}">
<span v-if="row.DEVICE_TYPE === 0" >闸机</span>
</template>
</el-table-column>
<el-table-column prop="STATUS" label="状态">
<template slot-scope="{ row }">
{{ row.STATUS == '0' ? '正常' : row.STATUS == '1' ? '停用' : '暂时关闭' }}
</template>
</el-table-column>
<el-table-column label="操作" width="400">
<template slot-scope="{row}">
<el-button
v-show="edit"
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleEdit(row.DEVICE_ID)">修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
map: null,
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
dialogFormMap: false,
PATH_ID: '',
DOOR_ID: '',
AREA_LEAVE: '',
DOOR_TYPE: '',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
form: {
PATH_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
ls: [],
dates: [],
total: 0,
KEYWORDS: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.PATH_ID = this.$parent.PATH_ID
this.DOOR_ID = this.$parent.DOOR_ID
this.AREA_LEAVE = this.$parent.AREA_LEAVE
this.DOOR_TYPE = this.$parent.DOOR_TYPE
this.getList()
this.hasButton()
},
methods: {
getRowKey(row) {
return row.PATH_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.activeName = 'EditDevice'
this.$parent.PATH_ID = this.PATH_ID
this.$parent.DOOR_ID = this.DOOR_ID
this.$parent.DOOR_TYPE = this.DOOR_TYPE
this.$parent.DEVICE_ID = ''
},
handleDevice() {
this.$parent.activeName = 'ListDevice'
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
this.HIDDENREGION_ID = pid
requestFN(
'/mkmjDevice/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
PATH_ID: this.PATH_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
handleEdit(DEVICE_ID) {
this.$parent.DEVICE_ID = DEVICE_ID
this.$parent.activeName = 'EditDevice'
},
handleMap(row) {
this.dialogFormMap = true
this.form = {
PATH_ID: row.PATH_ID,
LATITUDE: row.LATITUDE,
LONGITUDE: row.LONGITUDE
}
this.$nextTick(() => {
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
})
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.DEVICE_NAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjDevice/delete',
{
DEVICE_ID: row.DEVICE_ID
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
setPosition() {
this.dialogFormMap = false
this.listLoading = true
requestFN(
'/mkmjDevice/savePosition',
{
LATITUDE: this.form.LATITUDE,
LONGITUDE: this.form.LONGITUDE,
PATH_ID: this.form.PATH_ID
}
).then((data) => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'mkmjDoor:add,mkmjDoor:del,mkmjDoor:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjDoorfhadminadd //
this.del = data.mkmjDoorfhadmindel //
this.edit = data.mkmjDoorfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'ListPath'
}
}
}
</script>
<style scoped>
#map{
width: 1000px;
height: 500px;
}
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,340 @@
<template>
<div class="app-container">
<div class="level-title">
<h1>{{ this.$parent.DOOR_ID == '' ? "新增" : "修改" }}</h1>
</div>
<div>
<el-form v-loading="dialogFormVisible" ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="所属分公司:" prop="CORPINFO_ID">
<el-select v-model="form.CORPINFO_ID" filterable placeholder="请选择" style="width: 205px">
<el-option
v-for="item in corpList"
:key="item.CORPINFO_ID"
:label="item.CORP_NAME"
:value="item.CORPINFO_ID"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="口门名称:" prop="DOOR_NAME">
<el-input v-model="form.DOOR_NAME" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="口门类型:" prop="DOOR_TYPE">
<el-select v-model="form.DOOR_TYPE" style="width: 100%;">
<el-option v-for="item in typeList" :key="item.VALUE" :label="item.NAME" :value="item.VALUE" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态:" prop="STATUS">
<el-select v-model="form.STATUS" style="width: 100%;">
<el-option v-for="item in statusList" :key="item.VALUE" :label="item.NAME" :value="item.VALUE" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="经纬度:" class="is-required">
<el-input v-model="form.LONGITUDEANDLATITUDE" style="width:206px" placeholder="请选择" disabled/>
<el-button style="margin-left: 10px" type="primary" @click="handleMap"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="ui-foot">
<el-button type="success" @click="confirm"> </el-button>
<el-button plain type="info" @click="goBack"> </el-button>
</div>
<el-dialog :visible.sync="dialogFormMap" title="定位" width="1050px" class="dy-dialog">
<div id="cesiumContainer" />
<div slot="footer" class="dialog-footer">
<span>经度</span>
<el-input v-model="form.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<span>纬度</span>
<el-input v-model="form.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<el-button @click="dialogFormMap = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree'
import waves from '@/directive/waves'
import TiandiMap from '../../../../components/TianMap/TiandiMap'
let viewer = null
const Cesium = window.Cesium
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWQ0MGYwMy0yODUwLTQ1YzktOGM4OC02MTMwY2UyZjNlMzQiLCJpZCI6MTY0NTUwLCJpYXQiOjE2OTM4OTU1Mjd9.1cC0sSzyj79LZv0ILNCcl0Mabw6hl8TNngFNFr7H8f4'
var subdomains = ['0', '1', '2', '3', '4', '5', '6', '7']
var tiandituTk = 'e8a16137fd226a62a23cc7ba5c9c78ce'
const img_h = require('../../../../assets/images/map/h.png')
export default {
components: { Pagination, SelectTree, TiandiMap },
directives: { waves },
data() {
return {
dialogFormMap: false,
dialogFormVisible: false,
dialogTableVisible: false,
PERSON_CHARGE: '',
DEPARTMENT_ID_OLD: '',
form: {
CORPINFO_ID: '',
DOOR_NAME: '',
DOOR_TYPE: '',
STATUS: '',
LONGITUDE: '',
LATITUDE: '',
LONGITUDEANDLATITUDE: ''
},
corpList: [],
riskForm: {},
KEYWORDS: '',
rules: {
CORPINFO_ID: [{ required: true, message: '所属分公司不能为空', trigger: 'blur' }],
DOOR_NAME: [{ required: true, message: '口门名称不能为空', trigger: 'blur' }],
DOOR_TYPE: [{ required: true, message: '口门类型不能为空', trigger: 'blur' }],
STATUS: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
},
formLabelWidth: '120px',
fullscreenLoading: false,
total: 0,
listQuery: {
page: 1,
limit: 20
},
multipleSelection: [],
accidentList: [],
typeList: [
{ NAME: '人行口门', VALUE: 0 },
{ NAME: '车行口门', VALUE: 1 }
],
statusList: [
{ NAME: '正常', VALUE: 0 },
{ NAME: '停用', VALUE: 1 },
{ NAME: '暂时关闭', VALUE: 2 }
]
}
},
watch: {
},
async created() {
viewer = null
this.DOOR_ID = this.$parent.DOOR_ID
this.form.DOOR_NAME = this.$parent.DOOR_NAME
this.form.DOOR_TYPE = this.$parent.DOOR_TYPE
this.form.STATUS = this.$parent.STATUS
this.getCorpList()
if (this.DOOR_ID) {
this.getDataByID()
}
},
methods: {
setPosition() {
this.form.LONGITUDEANDLATITUDE = this.form.LATITUDE + '--' + this.form.LONGITUDE
this.dialogFormMap = false
},
/**
* 初始化天地图对象
*/
/* initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
console.log('天地图初始化成功...')
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},*/
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain()
animation: false, //
homeButton: true, // home
geocoder: true, //
baseLayerPicker: false, //
timeline: false, //
fullscreenButton: true, //
infoBox: true, //
sceneModePicker: true, // /
navigationInstructionsInitiallyVisible: false, //
navigationHelpButton: false, //
selectionIndicator: false, //
imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
//
url: 'http://t{s}.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=' + tiandituTk,
subdomains: subdomains,
layer: 'tdtImgLayer',
style: 'default',
format: 'image/jpeg',
tileMatrixSetID: 'GoogleMapsCompatible', // 使
show: true
})
})
viewer._cesiumWidget._creditContainer.style.display = 'none' // cesium ion
Cesium.ExperimentalFeatures.enableModelExperimental = true
var tile3d = new Cesium.Cesium3DTileset({
url: config.mapJsonUrl
})
viewer.scene.primitives.add(tile3d)
this.toCenter(lng, lat, zoom)
this.leftDownAction()
},
toCenter(LONGITUDE, LATITUDE, height) {
if (!LONGITUDE && !LATITUDE) {
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(119.58, 39.94, height)
})
viewer.entities.removeAll()
} else {
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(LONGITUDE, LATITUDE, height)
})
viewer.entities.removeAll()
this.form.LONGITUDE = LONGITUDE
this.form.LATITUDE = LATITUDE
this.addPoint([LONGITUDE, LATITUDE], 'init')
}
},
leftDownAction() {
// entity start
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK)
// entity end
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas)
handler.setInputAction(event => {
viewer.entities.removeAll()
const clickPosition = viewer.scene.camera.pickEllipsoid(event.position) //
const radiansPos = Cesium.Cartographic.fromCartesian(clickPosition) //
this.form.LONGITUDE = Cesium.Math.toDegrees(radiansPos.longitude)
this.form.LATITUDE = Cesium.Math.toDegrees(radiansPos.latitude)
this.addPoint(clickPosition, 'click')
}, Cesium.ScreenSpaceEventType.LEFT_CLICK)
},
addPoint(position, type) {
viewer.entities.add({ position: type === 'init' ? Cesium.Cartesian3.fromDegrees(...position) : position, billboard: {
image: img_h,
height: 25,
width: 23,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY
}})
},
handleMap() {
this.dialogFormMap = true
this.$nextTick(() => {
if (!viewer) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 5000)
else this.toCenter(this.form.LONGITUDE, this.form.LATITUDE, 5000)
/* else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)*/
})
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.$parent.DOOR_ID == '') {
this.handleAdd()
} else {
if (valid) {
this.listLoading = true
requestFN(
'/mkmjDoor/edit',
this.form
).then((data) => {
this.goBack()
this.listLoading = false
this.dialogFormEdit = false
}).catch((e) => {
this.listLoading = false
})
}
}
}
})
},
handleAdd() {
requestFN(
'/mkmjDoor/add',
this.form
).then((data) => {
if (data.msg === '保存成功') {
this.$message.success(data.msg)
this.goBack()
} else {
this.$message.warning(data.msg)
}
}).catch((e) => {
})
},
getDataByID() {
this.listLoading = true
this.dialogFormVisible = true
requestFN(
'/mkmjDoor/goEdit',
{ DOOR_ID: this.DOOR_ID }
).then((data) => {
this.form = data.pd
this.form.LONGITUDEANDLATITUDE = this.form.LATITUDE + '--' + this.form.LONGITUDE
this.dialogFormVisible = false
}).catch((e) => {
this.dialogFormVisible = false
this.listLoading = false
})
},
getCorpList() {
requestFN(
'/corpinfo/getSelectByCorpInfo',
{
}
).then((data) => {
this.corpList = JSON.parse(data.corpInfoJson)
}).catch((e) => {
})
},
//
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style>
#cesiumContainer{
width: 1000px;
height: 500px;
margin: auto;
}
.cesium-viewer-toolbar, .cesium-viewer-fullscreenContainer, .cesium-infoBox-visible {
display: none !important;
}
</style>

View File

@ -0,0 +1,208 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="人名/车牌号" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入名称"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="NAME" label="人员名称/车牌号"/>
<el-table-column prop="STATUS" label="进出类型"/>
<el-table-column prop="TIME" label="进出时间"/>
<el-table-column prop="BAYNAME" label="进出位置"/>
<el-table-column prop="DOORNAME" label="口门名称"/>
</el-table>
<div class="page-btn-group">
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
map: null,
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
dialogFormMap: false,
DOOR_ID: '',
AREA_LEAVE: '',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
form: {
PATH_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
ls: [],
dates: [],
DOOR_TYPE: '',
total: 0,
KEYWORDS: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.DOOR_ID = this.$parent.DOOR_ID
this.DOOR_TYPE = this.$parent.DOOR_TYPE
this.getList()
this.hasButton()
},
methods: {
getRowKey(row) {
return row.PATH_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.activeName = 'EditPath'
this.$parent.DOOR_ID = this.DOOR_ID
this.$parent.PATH_ID = ''
},
handleDevice(row) {
this.$parent.activeName = 'ListDevice'
this.$parent.PATH_ID = row.PATH_ID
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
this.HIDDENREGION_ID = pid
requestFN(
'/mkmjPath/getInfoList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
DOOR_ID: this.DOOR_ID,
DOOR_TYPE: this.DOOR_TYPE
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
hasButton: function() {
var keys = 'mkmjDoor:add,mkmjDoor:del,mkmjDoor:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjDoorfhadminadd //
this.del = data.mkmjDoorfhadmindel //
this.edit = data.mkmjDoorfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style scoped>
#map{
width: 1000px;
height: 500px;
}
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,284 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="口门名称" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入关键字"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="DOOR_NAME" label="口门名称"/>
<el-table-column prop="DOOR_TYPE" label="口门类型">
<template slot-scope="{ row }">
{{ row.DOOR_TYPE == '0' ? '人行口门' : row.DOOR_TYPE == '1' ? '车行口门' : '综合口门' }}
</template>
</el-table-column>
<el-table-column prop="STATUS" label="状态">
<template slot-scope="{ row }">
{{ row.STATUS == '0' ? '正常' : row.STATUS == '1' ? '停用' : '暂时关闭' }}
</template>
</el-table-column>
<el-table-column prop="LONGITUDE" label="地理位置">
<template slot-scope="{ row }">
{{ row.LONGITUDE }} -- {{ row.LATITUDE }}
</template>
</el-table-column>
<el-table-column prop="VIDEOCOUNT" label="视频个数"/>
<el-table-column prop="PATHCOUNT" label="通道个数"/>
<el-table-column label="操作" width="550">
<template slot-scope="{row}">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
@click="handleInfoView(row)">查看记录
</el-button>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleEdit(row.DOOR_ID)">修改
</el-button>
<el-button
v-show="edit"
type="success"
icon="el-icon-setting"
size="mini"
@click="handleOpen(row)">添加通道
</el-button>
<el-button
v-show="edit"
type="success"
icon="el-icon-setting"
size="mini"
@click="handleVideo(row)">添加视频
</el-button>
<el-button
v-if="del"
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
DOOR_ID: '',
AREA_LEAVE: '1',
AREA_PARENT_ID: '0',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
ls: [],
dates: [],
total: 0,
KEYWORDS: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
console.log(val)
this.$refs.tree.filter(val)
}
},
created() {
this.getList()
this.hasButton()
},
methods: {
handleVideo(row) {
this.$parent.activeName = 'VideoList'
this.$parent.DOOR_ID = row.DOOR_ID
this.$parent.CORPINFO_ID = row.CORPINFO_ID
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
getRowKey(row) {
return row.DOOR_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.activeName = 'Edit'
this.$parent.AREA_LEAVE = this.AREA_LEAVE
this.$parent.AREA_PARENT_ID = this.AREA_PARENT_ID
this.$parent.DOOR_ID = this.DOOR_ID
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
this.HIDDENREGION_ID = pid
requestFN(
'/mkmjDoor/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
handleInfoView(row) {
this.$parent.DOOR_ID = row.DOOR_ID
this.$parent.DOOR_TYPE = row.DOOR_TYPE
this.$parent.activeName = 'InfoList'
},
handleEdit(DOOR_ID) {
this.$parent.DOOR_ID = DOOR_ID
this.$parent.activeName = 'Edit'
},
handleOpen(row) {
this.$parent.DOOR_ID = row.DOOR_ID
this.$parent.DOOR_TYPE = row.DOOR_TYPE
this.$parent.CORPINFO_ID = row.CORPINFO_ID
this.$parent.activeName = 'ListPath'
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.AREA_NAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjDoor/delete',
{
DOOR_ID: row.DOOR_ID
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'mkmjDoor:add,mkmjDoor:del,mkmjDoor:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjDoorfhadminadd //
this.del = data.mkmjDoorfhadmindel //
this.edit = data.mkmjDoorfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,297 @@
<template>
<div class="app-container">
<div class="rightCont">
<el-form label-width="50px">
<el-row>
<el-col :span="4">
<el-form-item label="通道名称" label-width="110px">
<el-input v-model="KEYWORDS" placeholder="请输入通道名称"/>
</el-form-item>
</el-col>
<el-col :span="4"/>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
border
tooltip-effect="dark"
style="width: 100%">
<el-table-column :selectable="selectable" type="selection" reserve-selection width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="PATH_NAME" label="通道名称"/>
<el-table-column label="通道类型">
<template slot-scope="{row}">
<span v-if="row.PATH_TYPE === 0" >人行通道</span>
<span v-else-if="row.PATH_TYPE === 1" >车行通道</span>
<span v-else-if="row.PATH_TYPE === 2" >综合通道</span>
</template>
</el-table-column>
<el-table-column prop="DEVICECOUNT" label="设备数"/>
<el-table-column label="操作" width="400">
<template slot-scope="{row}">
<el-button
v-show="edit"
type="primary"
icon="el-icon-edit"
size="mini"
@click="handleEdit(row.PATH_ID)">修改
</el-button>
<el-button type="success" icon="el-icon-location-information" size="mini" @click="handleDevice(row)"></el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete(row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList()"/>
</div>
</div>
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
map: null,
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
dialogFormMap: false,
DOOR_ID: '',
AREA_LEAVE: '',
addBtnType: true,
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
form: {
PATH_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
DOOR_TYPE: '',
ls: [],
dates: [],
total: 0,
KEYWORDS: '',
//
filterText: '',
varList: [],
pd: [],
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.AREA_LEAVE = this.$parent.AREA_LEAVE
this.DOOR_TYPE = this.$parent.DOOR_TYPE
this.DOOR_ID = this.$parent.DOOR_ID
this.getList()
this.hasButton()
},
methods: {
getRowKey(row) {
return row.PATH_ID
},
selectable(row, index) {
return row.ITEMCOUNT == 0
},
//
handleAdd() {
this.$parent.activeName = 'EditPath'
this.$parent.DOOR_ID = this.DOOR_ID
this.$parent.DOOR_TYPE = this.DOOR_TYPE
this.$parent.PATH_ID = ''
},
handleDevice(row) {
this.$parent.PATH_ID = row.PATH_ID
this.$parent.DOOR_TYPE = this.DOOR_TYPE
this.$parent.DOOR_ID = this.DOOR_ID
this.$parent.activeName = 'ListDevice'
},
//
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getList(pid) {
this.listLoading = true
this.varList = []
this.HIDDENREGION_ID = pid
requestFN(
'/mkmjPath/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
DOOR_ID: this.DOOR_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
}, goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
handleEdit(PATH_ID) {
this.$parent.PATH_ID = PATH_ID
this.$parent.activeName = 'EditPath'
},
handleMap(row) {
this.dialogFormMap = true
this.form = {
PATH_ID: row.PATH_ID,
LATITUDE: row.LATITUDE,
LONGITUDE: row.LONGITUDE
}
this.$nextTick(() => {
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
})
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.GATE_NAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/mkmjPath/delete',
{
PATH_ID: row.PATH_ID
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
setPosition() {
this.dialogFormMap = false
this.listLoading = true
requestFN(
'/mkmjPath/savePosition',
{
LATITUDE: this.form.LATITUDE,
LONGITUDE: this.form.LONGITUDE,
PATH_ID: this.form.PATH_ID
}
).then((data) => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'mkmjDoor:add,mkmjDoor:del,mkmjDoor:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.mkmjDoorfhadminadd //
this.del = data.mkmjDoorfhadmindel //
this.edit = data.mkmjDoorfhadminedit //
this.toExcel = data.toExcel // excel
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style scoped>
#map{
width: 1000px;
height: 500px;
}
.returnBtn {
float: right;
}
.app-container {
display: flex; /**/
align-items: baseline;
}
.rightCont {
width: 100%
}
</style>

View File

@ -0,0 +1,179 @@
<template>
<el-dialog
v-if="visible"
:visible.sync="visible"
:before-close="handleClose"
:append-to-body="true"
title="固定摄像头"
width="60%">
<div class="app-container">
<div class="filter-container">
<el-form>
<el-row :gutter="20">
<el-col :span="6"> <el-form-item label="视频名称">
<el-input v-model="KEYWORDS" placeholder="请输入关键字" class="filter-item" style="width: 150px;"/>
</el-form-item></el-col>
<el-col :span="6">
<el-form-item >
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="NAME" label="视频名称" />
<el-table-column prop="REGIONNAME" label="区域" />
<el-table-column label="操作" align="left" width="500">
<template slot-scope="{row}">
<el-button v-show="row.in !== 1" type="success" icon="el-icon-caret-right" size="mini" @click="selectVideo(row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="closeWindow"> </el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
config: config,
visible: false,
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
allCodes: []
}
},
methods: {
async init() {
this.visible = true
this.varList = []
this.KEYWORDS = ''
await this.getAllList()
this.getList()
},
getRowKey(row) {
return row.PLATFORMDOORVIDEO_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
getAllList() {
return new Promise(resolve => {
requestFN(
'/mkmjDoorVideo/list?showCount=1000&currentPage=1',
{
DOOR_ID: this.$parent.DOOR_ID
}
).then((data) => {
const tempList = data.varList
const allCodes = []
tempList.forEach(item => {
allCodes.push(item.INDEXCODE)
})
this.allCodes = allCodes
resolve()
}).catch((e) => {
})
})
},
//
getList() {
this.listLoading = true
requestFN(
'/platform/door/video/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
CORPINFO_ID: this.$parent.CORPINFO_ID
}
).then((data) => {
this.listLoading = false
// bug 12403 线
const tempList = data.varList.filter(item => {
return this.allCodes.indexOf(item.INDEXCODE) == -1
})
// tempList.forEach(item => {
// if (this.allCodes.indexOf(item.INDEXCODE) !== -1) {
// item.in = 1
// }
// })
this.varList = tempList
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
selectVideo(row) {
this.$emit('handleSelected', row)
this.closeWindow()
},
goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
handleClose() {
this.visible = false
},
closeWindow() {
this.handleClose()
}
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>

View File

@ -0,0 +1,579 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-form label-width="100px">
<el-row>
<el-col :span="5">
<el-form-item label="关键字搜索">
<el-input v-model="KEYWORDS" placeholder="搜索关键字" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="NAME" label="视频名称" />
<el-table-column prop="POSITION" label="状态" width="100">
<template slot-scope="{row}">
<span v-if="row.LATITUDE && row.LONGITUDE"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="500">
<template slot-scope="{row}">
<el-button :disabled="STATE == 2" type="success" icon="el-icon-caret-right" size="mini" @click="showVideo(row)"></el-button>
<el-button type="info" icon="el-icon-location-information" size="mini" @click="handleMap(row)"></el-button>
<el-button v-show="del" :disabled="STATE == 2" type="danger" icon="el-icon-delete" plain @click="handleDelete(row.DOOR_VIDEO_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group" style="margin-bottom: 50px;">
<div>
<el-button v-show="add" :disabled="STATE == 2" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<div class="ui-foot">
<el-button plain type="info" @click="goBack"> </el-button>
</div>
<el-dialog :visible.sync="dialogFormMap" title="定位" width="1050px" class="dy-dialog">
<div id="map" />
<div slot="footer" class="dialog-footer">
<span>经度</span>
<el-input v-model="form.LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<span>纬度</span>
<el-input v-model="form.LATITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<el-button @click="dialogFormMap = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogForm" :title="msg==='add'?'新增':'编辑'" width="600px">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="width: 500px;">
<el-form-item label="视频类型">
<el-radio-group v-model="form.VIDEO_TYPE" @change="changeType($event)">
<el-radio :label="1">固定摄像头</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.VIDEO_TYPE===0" label="视频监控信息" prop="VIDEO_RESOURCES_ID">
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="selectBobileVideo()"></el-button>
</el-form-item>
<el-form-item v-if="form.VIDEO_TYPE===1" label="视频选择">
<el-button type="success" icon="el-icon-caret-right" size="mini" @click="selectVideo()"></el-button>
</el-form-item>
<el-form-item label="视频名称" prop="VIDEONAME">
<el-input :disabled="true" v-model="form.VIDEONAME" placeholder="这里输入视频名称..." />
</el-form-item>
<el-form-item v-if="form.VIDEO_TYPE===0" label="播放地址" prop="VIDEOURL">
<el-input :disabled="true" v-model="form.VIDEOURL" placeholder="这里输入播放地址..." />
</el-form-item>
<el-form-item label="摄像头编号" prop="CODE">
<el-input :disabled="true" v-model="form.CODE" placeholder="这里输入摄像头编号..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
<el-button type="primary" @click="upload"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideo" :visible.sync="dialogVideo" title="视频" width="600px">
<iframe :src="VIDEOURL" width="100%" height="380" allowfullscreen allow="autoplay; fullscreen;microphone" style="position: relative;border:none"/>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideoHLS" :visible.sync="dialogVideoHLS" :before-close="handleBack" title="视频" width="600px">
<div id="aLiVideoPlayer" class="prism-player"/>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<el-dialog v-if="dialogVideoAll" :visible.sync="dialogVideoAll" :before-close="handleBack" title="视频" width="1200px">
<!-- <iframe src="http://192.168.192.121:10800/?menu=no/#/screen" width="100%" height="500px" allowfullscreen allow="autoplay; fullscreen" style="position: relative;border:none"/>-->
<div style="display: flex;flex-wrap: wrap;justify-content: space-between">
<div v-for="(video,index) in videoList" :key="index" style="margin-bottom: 10px;width: 45%">
<iframe v-if="video.GBSVIDEOURL" :src="video.GBSVIDEOURL" width="100%" height="380" allowfullscreen allow="autoplay; fullscreen;microphone" style="position: relative;border:none"/>
<div v-if="video.HLSVIDEOURL" :id="'aLiVideoPlayer'+index" class="prism-player"/>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="back"> </el-button>
</div>
</el-dialog>
<platformvideo ref="platformvideo" @handleSelected="handleSelected"/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import Platformvideo from './platformvideo'
import TiandiMap from '../../../../components/TianMap/TiandiMap'
export default {
components: { Platformvideo, Pagination, TiandiMap },
directives: { waves },
data() {
return {
map: null,
marker: null,
BMap: '',
clientHeight: 500,
inputLocation: '',
msg: 'add',
config: config,
listLoading: true,
dialogForm: false,
dialogImageUrl: '',
dialogVisible: false,
dialogSelect: false,
add: true,
del: true,
edit: true,
dialogFormMap: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
STATE: this.$parent.STATE,
dates: [],
videoList: [],
videoResourcesList: [],
varList: [],
LATITUDE: '',
LONGITUDE: '',
disabledForm: true,
form: {
DOOR_ID: '',
VIDEO_RESOURCES_ID: '',
PLATFORMVIDEOMANAGEMENT_ID: '',
LATITUDE: '',
LONGITUDE: ''
},
zoom: 10,
rules: {
VIDEONAME: [{ required: true, message: '视频名称不能为空', trigger: 'blur' }],
VIDEOURL: [{ required: true, message: '播放地址不能为空', trigger: 'blur' }],
VIDEO_RESOURCES_ID: [{ required: true, message: '不能为空', trigger: 'change' }],
CODE: [{ required: true, message: '摄像头编号不能为空', trigger: 'blur' }]
},
dialogVideo: false,
timer: '',
dialogVideoHLS: false,
dialogVideoAll: false,
VIDEOURL: '',
player: {},
playerList: []
}
},
created() {
this.form.DOOR_ID = this.$parent.DOOR_ID
this.getList()
this.getVideoResourcesSelect()
},
beforeDestroy() {
this.map && this.map.removeEventListener('click', this.MapClick)
console.log('定时器关闭')
clearInterval(this.timer)
},
methods: {
getVideoResourcesSelect() {
requestFN(
'/videoResources/listAll', {
UNITS_ID: this.$parent.UNITS_ID
}
).then((res) => {
this.videoResourcesList = res.varList
})
},
/**
* 初始化天地图对象
*/
initTDT() {
return new Promise((resolve, reject) => {
if (window.T) {
console.log('天地图初始化成功...')
resolve(window.T)
reject('error')
}
}).then(T => {
window.T = T
})
},
/**
* 初始化地图
* @param {*} lng 经度
* @param {*} lat 纬度
* @param {*} zoom 缩放比例(1~18)
*/
initMap(lng, lat, zoom) {
this.initTDT().then((T) => {
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
//
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
//
this.map = new window.T.Map('map')
this.initCenter(lng, lat, zoom)
})
},
initCenter(lng, lat, zoom) {
//
if (!this.form.LONGITUDE && !this.form.LATITUDE) {
this.map.centerAndZoom(new window.T.LngLat(119.58, 39.94), zoom)
this.marker && this.map.removeOverLay(this.marker)
} else {
this.map.centerAndZoom(new window.T.LngLat(lng, lat), zoom)
this.marker && this.map.removeOverLay(this.marker)
this.form.LONGITUDE = lng
this.form.LATITUDE = lat
this.marker = new window.T.Marker(new window.T.LngLat(lng, lat))
//
this.map.addOverLay(this.marker)
}
//
this.map.setMapType(window.TMAP_HYBRID_MAP)
//
this.map.enableScrollWheelZoom()
//
this.map.enableInertia()
//
this.map.addEventListener('click', this.MapClick)
},
MapClick(event) {
this.marker && this.map.removeOverLay(this.marker)
this.form.LONGITUDE = event.lnglat.getLng()
this.form.LATITUDE = event.lnglat.getLat()
this.marker = new window.T.Marker(new window.T.LngLat(event.lnglat.getLng(), event.lnglat.getLat()))
//
this.map.addOverLay(this.marker)
},
handleMap(row) {
this.dialogFormMap = true
var DOOR_ID = this.form.DOOR_ID
this.form = {
DOOR_ID: DOOR_ID,
DOOR_VIDEO_ID: row.DOOR_VIDEO_ID,
LATITUDE: row.LATITUDE,
LONGITUDE: row.LONGITUDE
}
this.$nextTick(() => {
if (!this.map) this.initMap(this.form.LONGITUDE, this.form.LATITUDE, 16)
else this.initCenter(this.form.LONGITUDE, this.form.LATITUDE, 16)
})
},
getRowKey(row) {
return row.VIDEOMANAGER_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
//
start() {
console.log('定时器开启')
this.timer = setInterval(this.closeVideoStart, (5 * 60 * 1000)) // 5;
},
over() {
//
console.log('定时器手动关闭')
clearInterval(this.timer)
},
closeVideoStart() {
this.dialogVideo = false
this.dialogVideoHLS = false
this.dialogVideoAll = false
this.over()
},
//
showVideo(row) {
this.$message.warning('单次播放最多五分钟')
this.start()
if (!row.PLATFORMVIDEOMANAGEMENT_ID) {
this.VIDEOURL = row.VIDEOURL
this.dialogVideo = true
} else {
requestFN(
'/platformvideomanagement/getHlsPath',
{
INDEXCODE: row.INDEXCODE
}
).then((res) => {
this.dialogVideoHLS = true
this.$nextTick(() => {
// eslint-disable-next-line no-undef
this.player = new Aliplayer({
'id': 'aLiVideoPlayer',
'source': res.data.url,
'width': '100%',
'height': '500px',
'autoplay': true,
'isLive': true,
'rePlay': false,
'playsinline': true,
'preload': true,
'controlBarVisibility': 'hover',
'useH5Prism': true
}, function(player) {
console.log('The player is created')
})
})
}).catch((e) => {
this.listLoading = false
})
}
},
setPosition() {
this.dialogFormMap = false
this.listLoading = true
console.log(132)
requestFN(
'/mkmjDoorVideo/savePosition',
{
LATITUDE: this.form.LATITUDE,
LONGITUDE: this.form.LONGITUDE,
DOOR_VIDEO_ID: this.form.DOOR_VIDEO_ID
}
).then((data) => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
//
getList() {
this.listLoading = true
requestFN(
'/mkmjDoorVideo/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
DOOR_ID: this.form.DOOR_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.msg = 'add'
this.resetForm()
this.dialogForm = true
},
selectBobileVideo() {
this.$refs.bobileCamer.init(this.$parent.UNITS_ID)
},
selectVideo(row) {
this.$refs.platformvideo.init()
},
handleSelected(row) {
this.$set(this.form, 'VIDEONAME', row.NAME)
this.$set(this.form, 'CODE', row.INDEXCODE)
this.$set(this.form, 'LATITUDE', row.LATITUDE)
this.$set(this.form, 'LONGITUDE', row.LONGITUDE)
this.$set(this.form, 'PLATFORMVIDEOMANAGEMENT_ID', row.PLATFORMDOORVIDEO_ID)
},
//
upload() {
this.$refs.form.validate(valid => {
console.log(this.form)
if (valid) {
this.listLoading = true
requestFN(
'/mkmjDoorVideo/add',
{
PLATFORMVIDEOMANAGEMENT_ID: this.form.PLATFORMVIDEOMANAGEMENT_ID,
LONGITUDE: this.form.LONGITUDE,
LATITUDE: this.form.LATITUDE,
DOOR_ID: this.form.DOOR_ID
}
).then((data) => {
this.listLoading = false
this.dialogForm = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
console.log(this.VIDEOMANAGER_ID)
requestFN(
'/mkmjDoorVideo/delete',
{
DOOR_VIDEO_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'videomanager:add,videomanager:del,videomanager:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.videomanagerfhadminadd //
this.del = data.videomanagerfhadmindel //
this.edit = data.videomanagerfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.KEYWORDS = ''
this.getList()
},
changeType(e) {
if (e === 1) {
this.form.VIDEO_TYPE = 1
} else {
this.form.VIDEO_TYPE = 0
}
this.form.VIDEO_RESOURCES_ID = ''
this.form.VIDEONAME = ''
this.form.VIDEOURL = ''
this.form.CODE = ''
},
changeRid(e) {
console.log(e)
this.disabledForm = true
requestFN(
'/videoResources/findById',
{
VIDEO_RESOURCES_ID: e
}
).then((data) => {
this.form.VIDEOURL = data.pd.VIDEOURL
this.form.VIDEONAME = data.pd.VIDEONAME
this.form.CODE = data.pd.CODE
}).catch((e) => {
})
},
back() {
if (this.dialogVideo) this.dialogVideo = false
if (this.dialogVideoAll) {
this.dialogVideoAll = false
for (let i = 0; i < this.playerList.length; i++) {
this.playerList[i].dispose()
}
}
if (this.dialogForm) this.dialogForm = false
if (this.dialogVideoHLS) {
this.dialogVideoHLS = false
this.player.dispose()
}
},
handleBack() {
if (this.dialogVideoAll) {
for (let i = 0; i < this.playerList.length; i++) {
this.playerList[i].dispose()
}
this.dialogVideoAll = false
}
if (this.dialogVideoHLS) {
this.player.dispose()
this.dialogVideoHLS = false
}
},
resetForm() {
var DOOR_ID = this.form.DOOR_ID
this.form = {
VIDEO_TYPE: 1,
CODE: '',
DOOR_ID: DOOR_ID,
VIDEO_RESOURCES_ID: '',
PLATFORMVIDEOMANAGEMENT_ID: '',
LATITUDE: '',
LONGITUDE: ''
}
},
goBack() {
this.$parent.activeName = 'List'
}
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
#map{
width: 1000px;
height: 500px;
}
</style>

View File

@ -0,0 +1,47 @@
<template>
<!-- <component :is="activeName" />-->
<div>
<List v-if="activeName=='List'" ref="list" />
<ListPath v-if="activeName=='ListPath'" />
<Edit v-if="activeName=='Edit'" />
<EditPath v-if="activeName=='EditPath'" />
<ListDevice v-if="activeName=='ListDevice'" />
<EditDevice v-if="activeName=='EditDevice'" />
<VideoList v-if="activeName=='VideoList'" />
<InfoList v-if="activeName=='InfoList'"/>
</div>
</template>
<script>
import List from './components/list'
import ListPath from './components/listPath'
import Edit from './components/edit'
import EditPath from './components/EditPath'
import ListDevice from './components/ListDevice'
import EditDevice from './components/EditDevice'
import VideoList from './components/videoList'
import InfoList from './components/infoList'
export default {
components: {
VideoList: VideoList,
ListDevice: ListDevice,
List: List,
Edit: Edit,
ListPath: ListPath,
EditPath: EditPath,
EditDevice: EditDevice,
InfoList: InfoList
},
data() {
return {
activeName: 'List'
}
},
watch: {}
}
</script>
<style scoped>
</style>