2 次代码提交 767e4a541f ... f9d13dceeb

作者 SHA1 备注 提交日期
  lipenghui f9d13dceeb Merge remote-tracking branch 'origin/master' 1 周之前
  lipenghui d1b1393dc2 设备地图组织处理 1 周之前
共有 4 个文件被更改,包括 36 次插入7 次删除
  1. 2 2
      src/api/pms/device/index.ts
  2. 2 1
      src/locales/en.ts
  3. 2 1
      src/locales/zh-CN.ts
  4. 30 3
      src/views/pms/map/Map.vue

+ 2 - 2
src/api/pms/device/index.ts

@@ -46,8 +46,8 @@ export interface IotDeviceVO {
 
 
 // 设备台账 API
 // 设备台账 API
 export const IotDeviceApi = {
 export const IotDeviceApi = {
-  getMapDevice: async () => {
-    return await request.get({ url: `/rq/iot-device/map`})
+  getMapDevice: async (params:any) => {
+    return await request.get({ url: `/rq/iot-device/map`, params})
   },
   },
   // 查询设备台账分页
   // 查询设备台账分页
   getIotDevicePage: async (params: any) => {
   getIotDevicePage: async (params: any) => {

+ 2 - 1
src/locales/en.ts

@@ -640,7 +640,8 @@ export default {
     save:'Save',
     save:'Save',
     return:'Return',
     return:'Return',
     useProject:'useProject',
     useProject:'useProject',
-    assetOwner:'assetOwnership'
+    assetOwner:'assetOwnership',
+    deptHolder:'please select depart'
   },
   },
   file:{
   file:{
     name:'FileName',
     name:'FileName',

+ 2 - 1
src/locales/zh-CN.ts

@@ -637,7 +637,8 @@ export default {
     save:'保存',
     save:'保存',
     return:'返回',
     return:'返回',
     useProject:'使用项目',
     useProject:'使用项目',
-    assetOwner:'资产归属'
+    assetOwner:'资产归属',
+    deptHolder:'请选择部门机构'
   },
   },
   file:{
   file:{
     name:'文件名称',
     name:'文件名称',

+ 30 - 3
src/views/pms/map/Map.vue

@@ -16,6 +16,17 @@
       <button @click="zoomOut">{{t('map.reduce')}}</button>
       <button @click="zoomOut">{{t('map.reduce')}}</button>
       <button @click="toggleMapType"
       <button @click="toggleMapType"
       >{{t('map.SwitchMapType')}}({{ mapType === 'BMAP_NORMAL_MAP' ? '地图' : '卫星' }})</button>
       >{{t('map.SwitchMapType')}}({{ mapType === 'BMAP_NORMAL_MAP' ? '地图' : '卫星' }})</button>
+        <el-tree-select
+          class="my-el-select"
+          v-model="queryParams.deptId"
+          :data="treeList"
+          :props="defaultProps"
+          check-strictly
+          node-key="id"
+          :placeholder="t('deviceForm.deptHolder')"
+          filterable
+          @change="getData"
+        />
     </div>
     </div>
   </div>
   </div>
   <DeviceMonitorDrawer :model-value="drawerVisible" @update:model-value="(val) => (drawerVisible = val)" :id="deviceId" :deviceName="deviceName" :lastLineTime="lastLineTime"
   <DeviceMonitorDrawer :model-value="drawerVisible" @update:model-value="(val) => (drawerVisible = val)" :id="deviceId" :deviceName="deviceName" :lastLineTime="lastLineTime"
@@ -29,6 +40,7 @@ import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import DeviceMonitorDrawer from '@/views/pms/map/DeviceMonitorDrawer.vue'
 import DeviceMonitorDrawer from '@/views/pms/map/DeviceMonitorDrawer.vue'
 import * as DeptApi from '@/api/system/dept'
 import * as DeptApi from '@/api/system/dept'
+import {defaultProps, handleTree} from "@/utils/tree";
 
 
 interface Cluster {
 interface Cluster {
   lng: number
   lng: number
@@ -54,7 +66,7 @@ const inlineCount = ref(0)
 const outlineCount = ref(0)
 const outlineCount = ref(0)
 // 设备数据示例
 // 设备数据示例
 const devices = ref<IotDeviceVO[]>()
 const devices = ref<IotDeviceVO[]>()
-
+const treeList = ref<Tree[]>([]) // 树形结构
 // 初始化地图
 // 初始化地图
 const initMap = () => {
 const initMap = () => {
   if (!mapContainer.value) return
   if (!mapContainer.value) return
@@ -322,9 +334,12 @@ const toggleMapType = () => {
   mapType.value = mapType.value === 'BMAP_NORMAL_MAP' ? 'BMAP_SATELLITE_MAP' : 'BMAP_NORMAL_MAP'
   mapType.value = mapType.value === 'BMAP_NORMAL_MAP' ? 'BMAP_SATELLITE_MAP' : 'BMAP_NORMAL_MAP'
   map.value.setMapType((window as any)[mapType.value])
   map.value.setMapType((window as any)[mapType.value])
 }
 }
-
+const queryParams = reactive({
+  deptId: undefined
+})
 const getData = async () => {
 const getData = async () => {
-  await IotDeviceApi.getMapDevice().then((res) => {
+  debugger
+  await IotDeviceApi.getMapDevice(queryParams).then((res) => {
     devices.value = res.filter((item)=> item.lat!=0&&item.lng!=0)
     devices.value = res.filter((item)=> item.lat!=0&&item.lng!=0)
     outlineCount.value = devices.value.filter((item)=> item.ifInline===4).length
     outlineCount.value = devices.value.filter((item)=> item.ifInline===4).length
     inlineCount.value = devices.value.filter((item)=> item.ifInline===3).length
     inlineCount.value = devices.value.filter((item)=> item.ifInline===3).length
@@ -333,6 +348,10 @@ const getData = async () => {
 }
 }
 onMounted(async () => {
 onMounted(async () => {
   await getData()
   await getData()
+  const res = await DeptApi.getSimpleDeptList()
+  treeList.value = []
+  treeList.value.push(...handleTree(res))
+  debugger
 })
 })
 
 
 onBeforeUnmount(() => {
 onBeforeUnmount(() => {
@@ -429,4 +448,12 @@ onBeforeUnmount(() => {
   background-repeat: no-repeat;
   background-repeat: no-repeat;
   background-position: center;
   background-position: center;
 }
 }
+
+
+:deep(.el-select__selection) {
+  height: 35px; /* 自定义高度 */
+}
+:deep(.el-select__placeholder.is-transparent){
+  color: orangered;
+}
 </style>
 </style>