wenhongquan 3 years ago
parent
commit
bff79dedea

+ 19 - 4
src/views/IncidentDetail/AccidentCard/index.tsx

@@ -9,11 +9,12 @@ import {
   onMounted,
   onUnmounted,
   ref,
+  reactive,
 } from 'vue-demi';
 
 export default defineComponent({
   name: 'AccidentCard',
-  components:{
+  components: {
     authImg
   },
   setup() {
@@ -25,11 +26,18 @@ export default defineComponent({
 
     const carousel = ref(null);
 
-    
+    var rr = (store.incidentDetail?.baseInfo?.pic?.split(',') ?? []).length +
+      (store.incidentDetail?.baseInfo?.video?.split(',') ?? []).length;
+    const isshow = ref(rr>0);
 
     onMounted(() => { 
       setTimeout(() => {
-        carousel.value.setActiveItem(0);
+        try {
+           carousel.value.setActiveItem(0);
+        } catch (error) {
+          
+        }
+       
       }, 500);
     })
 
@@ -41,7 +49,14 @@ export default defineComponent({
     return () => (
       <Card cardType="accident-scene">
         <div>
-          <el-carousel ref={carousel} autoplay={false} arrow={"always"}>
+          <div class="dis"
+            v-show={
+              (store.incidentDetail?.baseInfo?.pic?.split(',') ?? []).length +
+              (store.incidentDetail?.baseInfo?.video?.split(',') ?? []).length<1
+            }>
+            暂无现场图像
+          </div>
+          <el-carousel ref={carousel} autoplay={false} arrow={'always'}>
             {(store.incidentDetail?.baseInfo?.pic?.split(',') ?? []).map(
               (item) => (
                 <el-carousel-item>

+ 11 - 1
src/views/IncidentDetail/index.scss

@@ -847,6 +847,16 @@
                     // }
                 }
             }
-            &-bg-accident-scene {}
+            &-bg-accident-scene {
+                position: relative;
+                .dis {
+                    font-size: px2rem(34px);
+                    top: px2rem(160px);
+                    position: absolute;
+                    width: 100%;
+                    text-align: center;
+                    left: 0;
+                }
+            }
         }
     }