소스 검색

页面调整

lipenghui 1 개월 전
부모
커밋
648b5ac8bc
3개의 변경된 파일14개의 추가작업 그리고 8개의 파일을 삭제
  1. 2 2
      src/views/pms/failure/IotFailureReportForm.vue
  2. 3 1
      src/views/pms/maintain/IotMaintain.vue
  3. 9 5
      src/views/pms/map/Map.vue

+ 2 - 2
src/views/pms/failure/IotFailureReportForm.vue

@@ -14,7 +14,7 @@
           :disabled="disabled"
           v-model="formData.deviceName"
           :placeholder="t('faultForm.choose')"
-          @click="openForm"
+          @click="disabled?null:openForm"
           clearable
           @clear="handleClear"
         />
@@ -114,7 +114,7 @@
       </el-row>
     </el-form>
     <template #footer>
-      <el-button @click="submitForm" type="primary" :disabled="formLoading">{{t('faultForm.ok')}}</el-button>
+      <el-button @click="submitForm" type="primary" v-if="!disabled" :disabled="formLoading">{{t('faultForm.ok')}}</el-button>
       <el-button @click="dialogVisible = false">{{t('faultForm.cancel')}}</el-button>
     </template>
     <DeviceList ref="deviceFormRef" @choose="deviceChoose" />

+ 3 - 1
src/views/pms/maintain/IotMaintain.vue

@@ -364,12 +364,14 @@ const addFormRules = reactive({
 
 const handleConfirm = () => {
   addFormData.value.bomNodeId = Math.floor(100000 + Math.random() * 900000)
+
   const index = list.value.findIndex((item) => item.name === addFormData.value.name)
   if (index !== -1) {
     message.warning("维修项重复")
     return
   }
-  list.value.push(addFormData.value)
+  const addItem = {...addFormData.value}
+  list.value.push(addItem)
   addItemVisible.value = false
 }
 const customerChoose = (row) => {

+ 9 - 5
src/views/pms/map/Map.vue

@@ -56,7 +56,7 @@ const initMap = () => {
     if ((window as any).BMap) {
       map.value = new (window as any).BMap.Map(mapContainer.value)
       const point = new (window as any).BMap.Point(104.114129, 37.550339)
-      map.value.centerAndZoom(point, 5.5)
+      map.value.centerAndZoom(point, 5)
 
       map.value.enableScrollWheelZoom(true)
       map.value.setMapType((window as any)[mapType.value])
@@ -85,7 +85,7 @@ const initDeviceMarkers = () => {
 
   const zoomLevel = map.value.getZoom()
   debugger
-  if (zoomLevel > 9) {
+  if (zoomLevel > 12) {
     // 高缩放级别下显示单个设备标记
     devices.value.forEach((device) => {
       const point = new (window as any).BMap.Point(device.lng, device.lat)
@@ -238,10 +238,14 @@ const clusterDevices = (devices: IotDeviceVO[], map: any): Cluster[] => {
 }
 
 const getGridSize = (zoom: number): number => {
-  if (zoom <= 5) return 2
+  if (zoom <= 5) return 3
+  if (zoom <= 7) return 2
   if (zoom <= 8) return 1
-  if (zoom < 10) return 0.03
-  return 0.1
+  if (zoom <= 9) return 0.09
+  if (zoom <= 10) return 0.08
+  if (zoom < 12) return 0.06
+  if (zoom < 15) return 0.02
+  return 0.01
 }
 
 const showDeviceInfoWindow = (device: IotDeviceVO, point: any) => {