Prechádzať zdrojové kódy

master: Fixed 修复ai告警信息

gitboyzcf 1 týždeň pred
rodič
commit
8f74f65206

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ VITE_APP_TITLE = 铁塔大视野
 
 # 网络请求
 # VITE_APP_API_BASEURL = https://192.168.10.140:8081
-VITE_APP_API_BASEURL = https://192.168.211.58:8082
+VITE_APP_API_BASEURL = https://192.168.211.44
 
 # 项目localStorage存储前缀
 VITE_APP_PREFIX = monitoring

+ 1 - 1
src/views/VideoMonitoring/components/RealTime.vue

@@ -84,6 +84,7 @@ const { API_AI_TYPE_GET } = useRequest()
 
 const typeObj = ref({})
 const alarmItem = ref({})
+provide('typeObj', typeObj)
 const clickAlarmItem = async (item) => {
   alarmItem.value = item
   showModal2.value = true
@@ -96,7 +97,6 @@ const openAll = () => (showModal.value = true)
 const clearAlarm = () => useSystem.aiList.forEach((item) => (item.state = 1))
 
 API_AI_TYPE_GET().then(res => {
-  console.log(res)
   typeObj.value = res
 })
 </script>

+ 5 - 1
src/views/VideoMonitoring/components/RealTimeImg.vue

@@ -17,9 +17,13 @@ import 'swiper/css/free-mode'
 import 'swiper/css/navigation'
 import 'swiper/css/thumbs'
 
+const typeObj = inject('typeObj')
 const viewer = ref(null)
 const loading = ref(true)
 
+console.log(typeObj);
+
+
 const useSystem = useOutsideSystemStore()
 const { API_IMG_FILES_GET } = useRequest()
 const props = defineProps({
@@ -60,7 +64,7 @@ const draw = () => {
           // 在矩形框内绘制矩形文字
           ctx.fillStyle = 'white'
           ctx.font = '26px Arial'
-          ctx.fillText(props.alarm.AlertType, rects.rect.x + 6, rects.rect.y - 4)
+          ctx.fillText(isRef(typeObj) ? typeObj.value[props.alarm.AlertType] : typeObj[props.alarm.AlertType], rects.rect.x + 6, rects.rect.y - 4)
         })
         canvas.toBlob((blob) => {
           // 创建一个指向该 Blob 的 URL

+ 6 - 9
src/views/VideoMonitoring/pages/RemotePlayback/components/TimeLine/index.vue

@@ -152,7 +152,7 @@ const props = defineProps({
   },
   // 多时间轴选中背景颜色
   multiSegmentActiveColor: {
-    type: String
+    type: String,
   },
   // 是否允许切换分辨率
   enableZoom: {
@@ -207,7 +207,7 @@ const props = defineProps({
   // 是否是手机端
   isMobile: {
     type: Boolean,
-    default: true
+    default: false
   },
   // 鼠标按下和松开的距离小于该值认为是点击事件
   maxClickDistance: {
@@ -534,7 +534,7 @@ const drawTimeSegments = (callback, path) => {
       let heightEndRatio = item.endRatio === undefined ? 0.9 : item.endRatio
       if (props.roundWidthTimeSegments) {
         x = Math.round(x)
-        w = Math.round(w)
+        w = Math.round(w) + 1
       }
       // 避免时间段小于1px绘制不出来
       w = Math.max(1, w)
@@ -579,9 +579,7 @@ const onMousedown = (e) => {
 // 按下事件
 const onPointerdown = (e) => {
   let pos = getClientOffset(e)
-  if (!props.isMobile) {
-    e.target.style.cursor = 'grabbing'
-  }
+  e.target.style.cursor = 'grabbing'
   defaultData.mousedownX = pos[0]
   defaultData.mousedownY = pos[1]
   defaultData.mousedown = true
@@ -610,9 +608,7 @@ let onMouseup = (e) => {
 // 松开事件
 const onPointerup = (e) => {
   // 触发click事件
-  if (!props.isMobile) {
-    e.target.style.cursor = 'pointer'
-  }
+  e.target.style.cursor = 'pointer'
   let pos = getClientOffset(e)
   const reset = () => {
     defaultData.mousedown = false
@@ -738,6 +734,7 @@ const onMouseweel = (event) => {
   let e = window.event || event
   let delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail))
   if (delta < 0) {
+    if(defaultData.currentZoomIndex === 9) return
     if (defaultData.currentZoomIndex + 1 >= ZOOM.length - 1) {
       defaultData.currentZoomIndex = ZOOM.length - 1
     } else {