wenhongquan 3 年之前
父節點
當前提交
a3d34052ef

+ 11 - 0
src/api/common.ts

@@ -63,6 +63,17 @@ export const upload = (file: File) => {
   });
 };
 
+export const getResourcefile = (params: Object) =>
+  request<Object>('GET', {
+    url: '/common/addlnoow/resource;',
+    params: params,
+  });
+
+
+
+
+
+
 export interface UserInfo {
   userId?: string;
   name?: string;

二進制
src/assets/card-bg/frame_czfa.png


二進制
src/assets/card-bg/frame_czfa@2x.png


二進制
src/assets/card-bg/frame_yjya@2x.png


+ 58 - 0
src/components/AuthImage/index.vue

@@ -0,0 +1,58 @@
+<template>
+  <img class="imgc"  ref="img" />
+</template>
+<style>
+.imgc{
+height:100%;width:100%;
+object-fit: contain;
+}
+</style>
+<script>
+import { defineComponent, onMounted, ref } from 'vue-demi';
+export default defineComponent({
+  name: 'authImg',
+  props: {
+    authSrc: {
+      type: String,
+      required: false,
+      default: '',
+    },
+  },
+  setup(props) {
+    const img = ref(null);
+    onMounted(() => {
+      console.log(img);
+      Object.defineProperty(Image.prototype, 'authsrc', {
+        writable: true,
+        enumerable: true,
+        configurable: true,
+      });
+
+      let request = new XMLHttpRequest();
+      request.responseType = 'blob';
+      request.open('get', props.authSrc, true);
+      request.setRequestHeader('AppId', '3bcb760743ea456faba29a1dfb247bf4');
+      request.setRequestHeader(
+        'Authorization',
+        'Bearer ' + window.localStorage.getItem('Authorization') ?? '',
+      );
+      request.onreadystatechange = (e) => {
+        if (
+          request.readyState == XMLHttpRequest.DONE &&
+          request.status == 200
+        ) {
+          img.value.src = URL.createObjectURL(request.response);
+          img.value.onload = () => {
+            URL.revokeObjectURL(img.src);
+          };
+        }
+      };
+      request.send(null);
+    });
+
+    return {
+      img,
+    };
+  },
+});
+</script>

+ 7 - 3
src/components/Card/index.scss

@@ -43,11 +43,15 @@
         margin-top: px2rem(-63px * 2);
     }
     &-bg-incident-plan {
+        margin-top: px2rem(20px *2);
         background-image: url('../../assets/card-bg/frame_czfa.png');
     }
     &-bg-emergency-linkage {
         background-image: url('../../assets/card-bg/frame_yjld.png');
     }
+    &-bg-emergency-plan {
+        background-image: url('../../assets/card-bg/frame_yjya@2x.png');
+    }
     &-bg-accident-scene {
         background-image: url('../../assets/card-bg/frame_sgxc@2x.png');
         width: px2rem(472px * 2);
@@ -77,9 +81,9 @@
     &-bg-execution-log {
         width: 939px;
         height: 554px;
-        width: px2rem(939px * 2);
-        height: px2rem(554px * 2 - 182px);
-        background-image: url('../../assets/card-bg/frame_zxrz.png');
+        width: px2rem(472px * 2);
+        height: px2rem(789px * 2);
+        background-image: url('../../assets/card-bg/frame_czfa@2x.png');
     }
     &-bg-live-monitoring {
         width: 943px;

+ 1 - 0
src/components/Card/index.tsx

@@ -10,6 +10,7 @@ export type CardType =
   | 'emergency-linkage'
   | 'execution-log'
   | 'accident-scene'
+  | 'emergency-plan'
   | 'live-monitoring';
 
 export default defineComponent({

+ 2 - 1
src/constants/constants.ts

@@ -1,4 +1,5 @@
-export const BaseMediaUrl = 'http://sqfile.xt.wenhq.top:8083';
+export const BaseMediaUrl =
+  'http://61.147.254.211:30876/YJZH-SQ/api/common/download/resource?resource=';
 export const BaseLoginUrl = 'http://61.147.254.211:9999/home/#/login';
 export const BaseReg = /^\+\+\+\+[\.]+|[\d|\w|\s|\u4e00-\u9fa5]+\+\+\+\+$/;
 

+ 3 - 0
src/utils/request.ts

@@ -108,3 +108,6 @@ export default function request<T>(
     },
   });
 }
+
+
+

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

@@ -1,4 +1,5 @@
 import Card from '@/components/Card';
+import authImg from '@/components/AuthImage/index.vue';
 import { BaseMediaUrl } from '@/constants/constants';
 import { useIncidentStore } from '@/store';
 import { time } from 'console';
@@ -12,6 +13,9 @@ import {
 
 export default defineComponent({
   name: 'AccidentCard',
+  components:{
+    authImg
+  },
   setup() {
     const store = useIncidentStore();
 
@@ -20,6 +24,9 @@ export default defineComponent({
     const current = ref(0);
 
     const carousel = ref(null);
+
+    
+
     onMounted(() => { 
       setTimeout(() => {
         carousel.value.setActiveItem(0);
@@ -38,11 +45,10 @@ export default defineComponent({
             {(store.incidentDetail?.baseInfo?.pic?.split(',') ?? []).map(
               (item) => (
                 <el-carousel-item>
+                  {/* <authImg authSrc={BaseMediaUrl+item} /> */}
                   <img
-                    style="height:100%;width:100%;object-fit: contain;"
-                    src={
-                      item
-                    }
+                    style="height:100%;width:100%;"
+                    src={BaseMediaUrl + item}
                   />
                 </el-carousel-item>
               ),

+ 13 - 5
src/views/IncidentDetail/CommandChainCard/index.tsx

@@ -27,13 +27,14 @@ export default defineComponent({
       commonStore.globalDict['zhdd_org_upload']?.find(
         (i) => i?.dictValue?.toString() === value?.toString(),
       )?.dictLabel ?? '-';
+    
     onMounted(() => {
 
 
     });
 
-    var templist = store?.incidentDetail?.baseInfo?.assistDept?.split(',');
-    const xblist = templist == undefined ? [] : templist ;
+
+    
     
     // const xblist = ['2', '2', '2', '2'];
     // console.log(xblist);
@@ -84,7 +85,14 @@ export default defineComponent({
               </div>
             </div>
           </div>
-          <div class="main-dept" v-show={xblist.length!=0}>
+          <div
+            class="main-dept"
+            style={
+              store?.incidentDetail?.baseInfo?.assistDept?.split(',').length !=
+              0
+                ? 'display:none'
+                : 'display:block'
+            }>
             <div>
               <div class="dept" datatype="2">
                 <img src={co_organizer} />
@@ -97,8 +105,8 @@ export default defineComponent({
               <div
                 class="leftline"
                 style="position: absolute;background: white;width: 1px;left: 0;"></div>
-              {xblist
-                ? xblist!
+              {store?.incidentDetail?.baseInfo?.assistDept?.split(',')
+                ? store?.incidentDetail?.baseInfo?.assistDept?.split(',')
                 : [].map((item, index) => (
                     <div
                       class="dept-name"

+ 34 - 0
src/views/IncidentDetail/EmergencyCard/index.tsx

@@ -0,0 +1,34 @@
+import Card from '@/components/Card';
+import { useIncidentStore } from '@/store';
+import { defineComponent, ref } from 'vue-demi';
+
+const lists = [
+  '生成处置方法',
+  '组织应急队伍',
+  '现场救援',
+  '这里处置方案文字这里处置方案文字',
+  '这里处置方案文字这里处置方案文字',
+  '这里处置方案文字这里处置方案文字',
+  '这里处置方案文字这里处置方案文字',
+];
+
+export default defineComponent({
+  name: 'EmergencyCard',
+  setup(props) {
+    const store = useIncidentStore();
+
+    const types = ref([]);
+
+    return () => (
+      <Card cardType="emergency-plan">
+        <div class="plan-container">
+          <el-checkbox-group v-model={types.value}>
+            {store?.incidentDetail?.task?.map((t) => (
+              <el-checkbox disabled class="plan-item" label={t.taskName} />
+            ))}
+          </el-checkbox-group>
+        </div>
+      </Card>
+    );
+  },
+});

+ 6 - 2
src/views/IncidentDetail/IncidentInfoCard/index.tsx

@@ -57,6 +57,11 @@ export default defineComponent({
       },
     ]);
 
+    setTimeout(() => {
+      console.log(store.incidentDetail?.baseInfo);
+    }, 2000);
+    
+    // debugger
     return () => (
       <Card cardType="incident-info">
         <div class="info-title">{ store.incidentDetail?.baseInfo?.name}</div>
@@ -75,8 +80,7 @@ export default defineComponent({
                       (i) =>
                         i.dictValue?.toString() ===
                         (
-                          store.incidentDetail?.baseInfo
-                            ?.type as unknown as string
+                          store.incidentDetail?.baseInfo[item.prop]
                         )?.toString(),
                     )?.dictLabel) ?? '-'}
               </div>

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

@@ -91,6 +91,8 @@
     .detail-right {
         right: px2rem(30px * 2);
         width: px2rem(939px * 2);
+        flex-direction: column;
+        max-height: 100%;
         // height: calc(px2rem(554px) + px2rem(390px) + px2rem(21px));
     }
     .echarts {
@@ -368,7 +370,7 @@
         &-bg-incident-plan {
             // top: px2rem(482px + 83px);
             // left: px2rem(30px);
-            margin-top: px2rem(21px * 2);
+            // margin-top: px2rem(21px * 2);
             margin-right: px2rem(21px * 2);
             .plan-container {
                 .el-checkbox__inner {

+ 5 - 3
src/views/IncidentDetail/index.tsx

@@ -15,6 +15,7 @@ import LiveMonitoringCard from './LiveMonitoringCard';
 import ExecutionLogCard from './ExecutionLogCard';
 import LiveVideoCard from './LiveVideoCard';
 import AccidentCard from './AccidentCard';
+import EmergencyCard from './EmergencyCard';
 import './index.scss';
 import { watch } from 'fs';
 import { isEmpty } from 'lodash';
@@ -105,15 +106,16 @@ export default defineComponent({
               {/* <IncidentPlanCard /> */}
               {/* <EmergencyLinkageCard /> */}
               <CommandChainCard />
-              <AccidentCard/>
+              <AccidentCard />
             </div>
           )}
 
           {!daHuaStore.dahuaUserVisible && (
             <div class="detail-right">
-               <IncidentPlanCard />
+              <EmergencyCard />
+              <IncidentPlanCard />
               <ExecutionLogCard />
-             
+
               {/* <LiveMonitoringCard /> */}
             </div>
           )}