diff --git a/src/api/ywts/shms/jy.js b/src/api/ywts/shms/jy.js index f3ac251..56f48e3 100644 --- a/src/api/ywts/shms/jy.js +++ b/src/api/ywts/shms/jy.js @@ -116,7 +116,7 @@ return request({ url: 'zhjy-gktj/zhjy/sbdwlb', method: 'post', - data, + // data, params: data }) } diff --git a/src/api/ywts/shms/jy.js b/src/api/ywts/shms/jy.js index f3ac251..56f48e3 100644 --- a/src/api/ywts/shms/jy.js +++ b/src/api/ywts/shms/jy.js @@ -116,7 +116,7 @@ return request({ url: 'zhjy-gktj/zhjy/sbdwlb', method: 'post', - data, + // data, params: data }) } diff --git a/src/pages/ywts/shms/jy/devicePop.vue b/src/pages/ywts/shms/jy/devicePop.vue new file mode 100644 index 0000000..2c44979 --- /dev/null +++ b/src/pages/ywts/shms/jy/devicePop.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/src/api/ywts/shms/jy.js b/src/api/ywts/shms/jy.js index f3ac251..56f48e3 100644 --- a/src/api/ywts/shms/jy.js +++ b/src/api/ywts/shms/jy.js @@ -116,7 +116,7 @@ return request({ url: 'zhjy-gktj/zhjy/sbdwlb', method: 'post', - data, + // data, params: data }) } diff --git a/src/pages/ywts/shms/jy/devicePop.vue b/src/pages/ywts/shms/jy/devicePop.vue new file mode 100644 index 0000000..2c44979 --- /dev/null +++ b/src/pages/ywts/shms/jy/devicePop.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/src/pages/ywts/shms/jy/index.vue b/src/pages/ywts/shms/jy/index.vue index b1eb984..1293f28 100644 --- a/src/pages/ywts/shms/jy/index.vue +++ b/src/pages/ywts/shms/jy/index.vue @@ -11,6 +11,8 @@ @click="selectIndex = 'keywordBtn'" @localPoint="localPoint" /> + + @@ -29,13 +31,15 @@ import mapJson from "@/assets/mapJson/map.json"; import modelJson from "@/assets/mapJson/school.json"; import { eventBus } from "../../../../main"; +import devicePop from './devicePop.vue' export default { name: 'Jy', - components: { SchoolPop, TimeManager, KeywordManager, LayerManagerMix, CommonBtn }, + components: { SchoolPop, TimeManager, KeywordManager, LayerManagerMix, CommonBtn, devicePop }, data() { return { isShow: false, + showDevice: false, ktSelect: '', keyword: '', keywordList: [], @@ -56,10 +60,15 @@ }, menus: { device: [ - { type: "1", typename: "视频设备", total: "111" }, - { type: "2", typename: "门禁设备", total: "111" } + { type: "1", typename: "视频设备", total: "0" }, + { type: "2", typename: "门禁设备", total: "0" } ] - } + }, + markerList: [], + markerBakList: [], + videoIcon: require('@/assets/images/icon/视频云/枪机未赋能在线.png'), + controlIcon: require('@/assets/images/icon/一卡通/门禁.png'), + } }, mounted() { @@ -194,10 +203,109 @@ }, // 搜索学校设备 searchDevice() { - getDevice({}).then(res => { - console.log('学校数据') + getDevice({ keywords: '' }).then(res => { + this.markerList = [ + { + "name": "设备1", + "lon": "114.859995", + "location": "江西省赣州市南康区三江乡", + "id": "1676397864375291905", + "lat": "25.802129", + "type": "1", + "typename": "视频设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备2", + "lon": "114.861027", + "location": "江西省赣州市章贡区潭六路135号靠近逸夫小学", + "id": "1676398916763914241", + "lat": "25.757553", + "type": "2", + "typename": "门禁设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备3", + "lon": "114.880246", + "location": "江西省赣州市章贡区潭东镇弘腾路毅德城", + "id": "1676414593390350337", + "lat": "25.753119", + "type": "1", + "typename": "视频设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备4", + "lon": "114.879855", + "location": "江西省赣州市章贡区潭东镇弘腾路毅德城", + "id": "1676414955455254529", + "lat": "25.752771", + "type": "1", + "typename": "视频设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备5", + "lon": "114.875438", + "location": "江西省赣州市章贡区潭东镇弘腾路毅德城", + "id": "1676418661630349312", + "lat": "25.748733", + "type": "2", + "typename": "门禁设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备6", + "lon": "114.867371", + "location": "江西省赣州市章贡区105国道135号靠近松岭上", + "id": "1676422908220542977", + "lat": "25.750388", + "typename": "2", + "typename": "门禁设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + ] + this.markerBakList = JSON.parse(JSON.stringify(this.markerList)) + this.menus.device[0].total = this.markerList.filter((item) => item.type === '1').length + this.menus.device[1].total = this.markerList.filter((item) => item.type === '2').length + // 绘制点位 + this.markerList.forEach((item) => { + AddLabelPoint( + item.id, + `${item.name}`, + item.type === '1' ? this.videoIcon : this.controlIcon, + [item.lon, item.lat, 0], 'yl-dev', item, + this.clickDevice) + }) }) - } + }, + // 设备点位点击 + clickDevice(eventArg) { + const item = eventArg._data.data + this.showDevice = true + this.$nextTick(() => { + this.$refs.deviceRef.initData(item) + }) + }, } } diff --git a/src/api/ywts/shms/jy.js b/src/api/ywts/shms/jy.js index f3ac251..56f48e3 100644 --- a/src/api/ywts/shms/jy.js +++ b/src/api/ywts/shms/jy.js @@ -116,7 +116,7 @@ return request({ url: 'zhjy-gktj/zhjy/sbdwlb', method: 'post', - data, + // data, params: data }) } diff --git a/src/pages/ywts/shms/jy/devicePop.vue b/src/pages/ywts/shms/jy/devicePop.vue new file mode 100644 index 0000000..2c44979 --- /dev/null +++ b/src/pages/ywts/shms/jy/devicePop.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/src/pages/ywts/shms/jy/index.vue b/src/pages/ywts/shms/jy/index.vue index b1eb984..1293f28 100644 --- a/src/pages/ywts/shms/jy/index.vue +++ b/src/pages/ywts/shms/jy/index.vue @@ -11,6 +11,8 @@ @click="selectIndex = 'keywordBtn'" @localPoint="localPoint" /> + + @@ -29,13 +31,15 @@ import mapJson from "@/assets/mapJson/map.json"; import modelJson from "@/assets/mapJson/school.json"; import { eventBus } from "../../../../main"; +import devicePop from './devicePop.vue' export default { name: 'Jy', - components: { SchoolPop, TimeManager, KeywordManager, LayerManagerMix, CommonBtn }, + components: { SchoolPop, TimeManager, KeywordManager, LayerManagerMix, CommonBtn, devicePop }, data() { return { isShow: false, + showDevice: false, ktSelect: '', keyword: '', keywordList: [], @@ -56,10 +60,15 @@ }, menus: { device: [ - { type: "1", typename: "视频设备", total: "111" }, - { type: "2", typename: "门禁设备", total: "111" } + { type: "1", typename: "视频设备", total: "0" }, + { type: "2", typename: "门禁设备", total: "0" } ] - } + }, + markerList: [], + markerBakList: [], + videoIcon: require('@/assets/images/icon/视频云/枪机未赋能在线.png'), + controlIcon: require('@/assets/images/icon/一卡通/门禁.png'), + } }, mounted() { @@ -194,10 +203,109 @@ }, // 搜索学校设备 searchDevice() { - getDevice({}).then(res => { - console.log('学校数据') + getDevice({ keywords: '' }).then(res => { + this.markerList = [ + { + "name": "设备1", + "lon": "114.859995", + "location": "江西省赣州市南康区三江乡", + "id": "1676397864375291905", + "lat": "25.802129", + "type": "1", + "typename": "视频设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备2", + "lon": "114.861027", + "location": "江西省赣州市章贡区潭六路135号靠近逸夫小学", + "id": "1676398916763914241", + "lat": "25.757553", + "type": "2", + "typename": "门禁设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备3", + "lon": "114.880246", + "location": "江西省赣州市章贡区潭东镇弘腾路毅德城", + "id": "1676414593390350337", + "lat": "25.753119", + "type": "1", + "typename": "视频设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备4", + "lon": "114.879855", + "location": "江西省赣州市章贡区潭东镇弘腾路毅德城", + "id": "1676414955455254529", + "lat": "25.752771", + "type": "1", + "typename": "视频设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备5", + "lon": "114.875438", + "location": "江西省赣州市章贡区潭东镇弘腾路毅德城", + "id": "1676418661630349312", + "lat": "25.748733", + "type": "2", + "typename": "门禁设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + { + "name": "设备6", + "lon": "114.867371", + "location": "江西省赣州市章贡区105国道135号靠近松岭上", + "id": "1676422908220542977", + "lat": "25.750388", + "typename": "2", + "typename": "门禁设备", + statusName: '正常', + time: '2025-06-16 09:05:05', + in: '0', + out: '0', + }, + ] + this.markerBakList = JSON.parse(JSON.stringify(this.markerList)) + this.menus.device[0].total = this.markerList.filter((item) => item.type === '1').length + this.menus.device[1].total = this.markerList.filter((item) => item.type === '2').length + // 绘制点位 + this.markerList.forEach((item) => { + AddLabelPoint( + item.id, + `${item.name}`, + item.type === '1' ? this.videoIcon : this.controlIcon, + [item.lon, item.lat, 0], 'yl-dev', item, + this.clickDevice) + }) }) - } + }, + // 设备点位点击 + clickDevice(eventArg) { + const item = eventArg._data.data + this.showDevice = true + this.$nextTick(() => { + this.$refs.deviceRef.initData(item) + }) + }, } } diff --git a/src/pages/ywts/zyhj/hb/index.vue b/src/pages/ywts/zyhj/hb/index.vue index 974bbf1..cb6936a 100644 --- a/src/pages/ywts/zyhj/hb/index.vue +++ b/src/pages/ywts/zyhj/hb/index.vue @@ -120,6 +120,17 @@ }, menuClick(e) { console.log(e, 'e') + clearResetMap() + this.markerList = this.markerListBak.filter(item => item.typename === e.type) + console.log(this.markerList) + this.markerList.forEach((item) => { + AddLabelPoint( + item.id, + `${item.name}`, + undefined, + [item.lon, item.lat, 0], 'yl-dev', item, + this.clickMarker) + }) }, // 获取概括统计 fetchData() {