From 4c77a55ae7445c01131de5e5a28a24e8ac0824ac Mon Sep 17 00:00:00 2001 From: wuhongjian Date: Tue, 28 Jun 2022 22:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/package.json | 1 + front/public/index.html | 7 +- front/src/supermap/advance-init.js | 40 +- .../home/detailsPageInfrastructureTree.vue | 2 + front/src/views/home/infrastructurePage.vue | 209 ++++----- .../views/home/videoSurveillance/index.vue | 415 ++++++------------ 6 files changed, 241 insertions(+), 433 deletions(-) diff --git a/back/package.json b/back/package.json index d6d934e7..e9ac8253 100644 --- a/back/package.json +++ b/back/package.json @@ -22,6 +22,7 @@ "carddragger": "^0.3.6", "clipboard": "^2.0.6", "core-js": "^3.6.5", + "crypto-js": "^4.1.1", "echarts": "^4.7.0", "element-ui": "^2.13.2", "file-saver": "^2.0.5", diff --git a/front/public/index.html b/front/public/index.html index 5a8fe4fe..afc695e8 100644 --- a/front/public/index.html +++ b/front/public/index.html @@ -1,8 +1,8 @@ @@ -47,7 +47,8 @@ window.SITE_CONFIG['backUrl'] = 'http://15.2.21.238:9797'; window.SITE_CONFIG['previewUrl'] = 'http://15.2.21.238:9796'; window.SITE_CONFIG['frontUrl'] = 'http://15.2.21.238:9796/document/#/devModelFile/'; - window.SITE_CONFIG['apiURL'] = 'http://15.2.21.238:8888/renren-admin'; + window.SITE_CONFIG['apiURL'] = 'http://15.2.21.239:8888/renren-admin'; + window.SITE_CONFIG['POI_URL'] = 'http://15.2.21.238:8090/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address'; // 穿透版本 // window.SITE_CONFIG['backUrl'] = 'http://124.222.94.39:9797'; // window.SITE_CONFIG['previewUrl'] = 'http://124.222.94.39:9796/'; diff --git a/front/src/supermap/advance-init.js b/front/src/supermap/advance-init.js index dc4320e3..9671313f 100644 --- a/front/src/supermap/advance-init.js +++ b/front/src/supermap/advance-init.js @@ -1681,6 +1681,7 @@ export function MapFun(mapObj) { // }) // } + _removeLayerByLayerName(layerName) let layers = null // 判断是否是聚合图层 layers = createMarkerClusterLayer() @@ -1691,12 +1692,7 @@ export function MapFun(mapObj) { features.map((feature) => { var bounds = map.getBounds() // console.log("看看有没有坐标",feature.latLng); - if ( - layerName == '全部' - ? feature.hasOwnProperty('latLng') && - bounds.contains(L.latLng(feature.latLng.lat, feature.latLng.lng)) - : feature.hasOwnProperty('latLng') - ) { + if ( feature.hasOwnProperty('latLng')) { const marker = L.marker(feature.latLng, { icon }) if (createPopupFun !== null) { marker.uuid = feature.uuid || '' @@ -1735,38 +1731,6 @@ export function MapFun(mapObj) { }) featureGroup.addLayer(layers) layerGroup.set(layerName, layers) - // map.on('zoom', () => { - // _removeLayerByLayerName(layerName) - // let layers = null - // // 判断是否是聚合图层 - // layers = createMarkerClusterLayer() - // features.map(feature => { - // var bounds = map.getBounds() - // // console.log("看看有没有坐标",feature.latLng); - // if (feature.hasOwnProperty('latLng') && bounds.contains(L.latLng(feature.latLng.lat, feature.latLng.lng))) { - // const marker = L.marker(feature.latLng, { icon }) - // if (createPopupFun !== null) { - // marker.uuid = feature.uuid || '' - // marker.resId = feature.resId || '' - // marker.on('click', async e => { - // if (feature.resourceName === 'video') { - // const params = [feature.indexCode] - // DS.openVideo(params) - // } else { - // const elementHtml = createPopupFun(feature) - // if (elementHtml) { - // console.log('L._addReMapWithter===============>', feature.latLng, elementHtml, map) - // L.popup({ className: 'detail-dialog' }).setLatLng(feature.latLng).setContent(elementHtml).openOn(map) - // } - // } - // }) - // } - // layers.addLayer(marker) - // } - // }) - // featureGroup.addLayer(layers) - // layerGroup.set(layerName, layers) - // }) } /** * 点击展示弹窗 diff --git a/front/src/views/home/detailsPageInfrastructureTree.vue b/front/src/views/home/detailsPageInfrastructureTree.vue index baa3362a..086313a2 100644 --- a/front/src/views/home/detailsPageInfrastructureTree.vue +++ b/front/src/views/home/detailsPageInfrastructureTree.vue @@ -243,6 +243,8 @@ const selectId = ref('') const onSelect = (item, val, child) => { console.log('item, val, child', child) + mybus.emit('getCameraByParentId', val.id) + mybus.emit('getListByParentId', val.id) getCameraAllOrgan({ parentId: val.id }).then((res) => { treeData.value.map((treeDataItem, index) => { if (item.id == treeDataItem.id) { diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index 1690d6b2..ecc029c5 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -19,7 +19,7 @@ -
+
@@ -28,7 +28,7 @@

备选 - {{ dataSource.length }} + {{ pagination.total }}

@@ -59,7 +59,7 @@
- + 添加至购物车 @@ -75,6 +75,7 @@ :dataSource="dataSource" :columns="columns" :scroll="{ y: tableHeight }" + rowKey="channelId" :rowClassName=" (record, index) => (index % 2 === 1 ? 'table-striped' : null) " @@ -93,9 +94,46 @@ import { getCategoryTreePage } from '@/api/personalCenter' import { dataType } from 'element-plus/es/components/table-v2/src/common' import { ref, onMounted } from 'vue' + import { getCameraByParentId } from '@/api/videoSurveillance' + import { sgcInsert } from '@/api/home' + import { message } from 'ant-design-vue' + import mybus from '@/myplugins/mybus' + + const pagination = ref({ + total: 0, + current: 1, + pageSize: 10, //每页中显示10条数据 + showSizeChanger: true, + pageSizeOptions: ['5', '10', '15', '20'], //每页中显示的数据 + }) + const mapSearchParam = ref({ + // 地图搜索初始化数据 + parentId: '', + checkStatus: '1', + pageNum: pagination.value.current, + pageSize: pagination.value.pageSize, + gpsX: '', + gpsY: '', + radius: '', + }) + const showMap = ref(true) onMounted(() => { tabClick(0, '视频资源') + getCamera() + mybus.off('getListByParentId') + mybus.on('getListByParentId', (parentId) => { + mapSearchParam.value.parentId = parentId + getCamera() + }) + mybus.off('getListByMap') + mybus.on('getListByMap', (param) => { + mapSearchParam.value.gpsX = param.gpsX + mapSearchParam.value.gpsY = param.gpsY + mapSearchParam.value.radius = param.radius + getCamera() + }) }) + const selectedList = ref([]) const tabList = ref([ { title: '设施类型', @@ -124,6 +162,10 @@ } clickList.value.push(params) }) + mybus.off('tranferToList') + mybus.on('tranferToList', (data) => { + console.log('获取到的列表数据') + }) } let clickList = ref([]) //存储点击的tab init() @@ -134,10 +176,13 @@ if (clickList.value[indexFather].content.indexOf(name) != -1) { if (name == '视频资源') { tableHeight.value = 330 + showMap.value = true } else if (name == '云资源') { tableHeight.value = 600 + showMap.value = false } else if (name == '感知资源') { tableHeight.value = 330 + showMap.value = true } clickList.value[indexFather].content.splice( clickList.value[indexFather].content.indexOf(name), @@ -146,6 +191,7 @@ } else { if (name == '视频资源') { tableHeight.value = 330 + showMap.value = true tabList.value[1].content = [] clickList.value[1].content = [] clickList.value[indexFather].content[0] = name @@ -161,6 +207,7 @@ }) } else if (name == '云资源') { tableHeight.value = 600 + showMap.value = false clickList.value[1].content = [] clickList.value[indexFather].content[0] = name tabList.value[1].content = [ @@ -175,6 +222,7 @@ ] } else if (name == '感知资源') { tableHeight.value = 330 + showMap.value = true clickList.value[1].content = [] clickList.value[indexFather].content[0] = name tabList.value[1].content = ['333333', '213124'] @@ -207,138 +255,53 @@ const addShopCar = () => { console.log('添加至购物车') } + const getCamera = () => { + console.log('初始化调用') + getCameraByParentId(mapSearchParam.value).then((res) => { + console.log('RRRRRRRRRR', res.data.data) + dataSource.value = res.data.data + pagination.value.total = res.data.count + }) + } + //加入申购车 + const addShoppingCart = () => { + sgcInsert({ + delFlag: '0', + resourceId: '8888888880000000001', + note1: selectedList.value, + // userId: userId.value, + }).then((res) => { + console.log(res) + message.success('添加申购车成功!') + mybus.emit('getSgcNum') + }) + } // 表格 - const dataSource = ref([ - { - key: '1', - name: '沈腾', - age: 32, - address: '西湖区湖底公园1号', - }, - { - key: '2', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '3', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '4', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '5', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '6', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '7', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '8', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '9', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '10', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '11', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '12', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '13', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '14', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '15', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '16', - name: '沈腾', - age: 42, - address: '西湖区湖底公园1号', - }, - ]) + const dataSource = ref([]) const columns = ref([ { - title: '姓名', - dataIndex: 'name', - key: 'name', + title: '名称', + dataIndex: 'channelName', + key: 'channelName', }, { - title: '年龄', - dataIndex: 'age', - key: 'age', - }, - { - title: '住址', - dataIndex: 'address', - key: 'address', + title: '归属', + dataIndex: 'nodeName', + key: 'nodeName', }, ]) const allClick = ref([]) - const onSelectChange = (selectedRowKeys) => { - console.log('hahhahah', selectedRowKeys) - allClick.value = selectedRowKeys + const onSelectChange = (selectedRowKeys, selectedRows) => { + console.log('hahhahah', selectedRowKeys, selectedRows) + selectedList.value = selectedRows + // allClick.value = selectedRowKeys } - const pagination = ref({ - total: 0, - pageSize: 10, //每页中显示10条数据 - showSizeChanger: true, - pageSizeOptions: ['5', '10', '15', '20'], //每页中显示的数据 - }) const handleTableChange = (val) => { pagination.value.current = val.current pagination.value.pageSize = val.pageSize - this.queryParam.page = val.current - this.queryParam.size = val.pageSize + mapSearchParam.value.pageNum = val.current + mapSearchParam.value.pageSize = val.pageSize + getCamera() // this.getTableList() } diff --git a/front/src/views/home/videoSurveillance/index.vue b/front/src/views/home/videoSurveillance/index.vue index e161113b..300cf7df 100644 --- a/front/src/views/home/videoSurveillance/index.vue +++ b/front/src/views/home/videoSurveillance/index.vue @@ -8,31 +8,16 @@
- - - - +