Преглед на файлове

feat: 天眼问题列表迁移

wyf преди 5 месеца
родител
ревизия
6435827185

+ 1 - 1
package.json

@@ -35,7 +35,7 @@
     "@vue-office/excel": "1.7.14",
     "@vue-office/excel": "1.7.14",
     "@vue-office/pdf": "2.0.10",
     "@vue-office/pdf": "2.0.10",
     "@vue-office/pptx": "1.0.1",
     "@vue-office/pptx": "1.0.1",
-    "@vueuse/core": "8.9.4",
+    "@vueuse/core": "14.0.0",
     "@vueuse/router": "10.6.1",
     "@vueuse/router": "10.6.1",
     "@wangeditor/editor-for-vue": "5.1.12",
     "@wangeditor/editor-for-vue": "5.1.12",
     "animate.css": "4.1.1",
     "animate.css": "4.1.1",

BIN
src/assets/images/institute-safety/item-active.png


BIN
src/assets/images/institute-safety/item-hover.png


BIN
src/assets/images/institute-safety/title-decoration.png


BIN
src/assets/images/institute-safety/violation-title-bg.png


+ 29 - 4
src/views/institute-safety/modules/safety-company-home/CompanyHome.vue

@@ -3,10 +3,10 @@
     <RealtimeSurveillance v-if="curCamera?.code" />
     <RealtimeSurveillance v-if="curCamera?.code" />
     <img v-else style="width: 100%" src="@/assets/images/sfy.jpg" alt="" />
     <img v-else style="width: 100%" src="@/assets/images/sfy.jpg" alt="" />
     <CompanyRating v-if="!curCamera?.code" />
     <CompanyRating v-if="!curCamera?.code" />
-    <ControlTab @open-surveillance-list="showSurveillanceList = true" @open-question-list="showQuestionList = true" />
+    <ControlTab @open-surveillance-list="showSurveillanceList = true" @open-question-list="handleOpenQuestionList" />
     <SurveillanceList v-if="showSurveillanceList" @close="showSurveillanceList = false" />
     <SurveillanceList v-if="showSurveillanceList" @close="showSurveillanceList = false" />
 
 
-    <!-- <QuestionList v-if="showQuestionList" /> -->
+    <QuestionList v-if="showQuestionList" @close="handleQuestionListClose" />
   </div>
   </div>
 </template>
 </template>
 
 
@@ -17,19 +17,44 @@
   import RealtimeSurveillance from './components/RealtimeSurveillance.vue';
   import RealtimeSurveillance from './components/RealtimeSurveillance.vue';
   import QuestionList from '../safety-question-list/QuestionList.vue';
   import QuestionList from '../safety-question-list/QuestionList.vue';
 
 
+  import useQuestionListStore from '@/views/institute-safety/modules/safety-company-home/stores/use-question-list';
+
   import useViolationNoticeCompany from './hooks/use-violation-notice-company';
   import useViolationNoticeCompany from './hooks/use-violation-notice-company';
   import useCameraStore from './stores/use-camera-store';
   import useCameraStore from './stores/use-camera-store';
-  import { onUnmounted, ref } from 'vue';
+  import { nextTick, onUnmounted, ref } from 'vue';
   import { storeToRefs } from 'pinia';
   import { storeToRefs } from 'pinia';
+  import { WORKSHOP_INFOS } from '../safety-workshop-list/constants';
 
 
   const showSurveillanceList = ref(false);
   const showSurveillanceList = ref(false);
-  const showQuestionList = ref(false);
 
 
   useViolationNoticeCompany();
   useViolationNoticeCompany();
 
 
   const cameraStore = useCameraStore();
   const cameraStore = useCameraStore();
   const { curCamera } = storeToRefs(cameraStore);
   const { curCamera } = storeToRefs(cameraStore);
 
 
+  const questionListStore = useQuestionListStore();
+  const { showQuestionList } = storeToRefs(questionListStore);
+
+  function handleOpenQuestionList() {
+    if (curCamera.value?.id) {
+      questionListStore.setState({
+        type: 'camera',
+        cameraId: curCamera.value.id,
+      });
+    } else {
+      questionListStore.setState({
+        type: 'all',
+        workshopCodes: WORKSHOP_INFOS.map((item) => item.workshopCode),
+      });
+    }
+    nextTick(() => {
+      questionListStore.openList();
+    });
+  }
+  function handleQuestionListClose() {
+    showQuestionList.value = false;
+  }
+
   onUnmounted(() => {
   onUnmounted(() => {
     cameraStore.clearCurCamera();
     cameraStore.clearCurCamera();
   });
   });

+ 1 - 1
src/views/institute-safety/modules/safety-company-home/apis/index.ts

@@ -13,7 +13,7 @@ export function getTodayIssueNumber() {
 // 通过相机id分页查询异常告警问题列表
 // 通过相机id分页查询异常告警问题列表
 export function getIssueListByCameraId(data: QueryPageRequest<number>) {
 export function getIssueListByCameraId(data: QueryPageRequest<number>) {
   return http.request<QueryPageResponse<IssueItem>>({
   return http.request<QueryPageResponse<IssueItem>>({
-    url: '/issue/queryIssuePageByWorkshopCodes',
+    url: '/issue/queryIssuePageByCameraId',
     method: 'post',
     method: 'post',
     data,
     data,
   });
   });

+ 5 - 0
src/views/institute-safety/modules/safety-company-home/components/RealtimeSurveillance.vue

@@ -18,6 +18,7 @@
   import { userSplitScreenFullScreen } from '@/store/modules/userSplitScreenFullScreen';
   import { userSplitScreenFullScreen } from '@/store/modules/userSplitScreenFullScreen';
   import { storeToRefs } from 'pinia';
   import { storeToRefs } from 'pinia';
   import screenfull from 'screenfull';
   import screenfull from 'screenfull';
+  import { onUnmounted } from 'vue';
 
 
   const { isFullScreen, curFullScreenType } = storeToRefs(userSplitScreenFullScreen());
   const { isFullScreen, curFullScreenType } = storeToRefs(userSplitScreenFullScreen());
   const { fullScreen, exitFullscreen } = userSplitScreenFullScreen();
   const { fullScreen, exitFullscreen } = userSplitScreenFullScreen();
@@ -32,6 +33,10 @@
   };
   };
 
 
   const { clearCurCamera, getCurCameraUrl, getCurCameraImg } = cameraStore;
   const { clearCurCamera, getCurCameraUrl, getCurCameraImg } = cameraStore;
+
+  onUnmounted(() => {
+    clearCurCamera();
+  });
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>

+ 32 - 0
src/views/institute-safety/modules/safety-company-home/stores/use-question-list.ts

@@ -0,0 +1,32 @@
+import { defineStore } from 'pinia';
+import { ref } from 'vue';
+
+const useQuestionListStore = defineStore('questionList', () => {
+  const showQuestionList = ref(false);
+  const ListType = ref<'all' | 'workshop' | 'camera'>('all');
+  const workshopCodes = ref<string[]>([]);
+  const cameraId = ref<number | null>();
+
+  const openList = () => {
+    if (showQuestionList.value === false) showQuestionList.value = true;
+  };
+  const closeList = () => {
+    if (showQuestionList.value === true) showQuestionList.value = false;
+  };
+  const getState = () => ({ type: ListType.value, workshopCodes: workshopCodes.value, cameraId: cameraId.value });
+  const setState = (data: { type: 'all' | 'workshop' | 'camera'; workshopCodes?: string[]; cameraId?: number }) => {
+    ListType.value = data.type;
+    console.log('setState', ListType.value);
+    workshopCodes.value = data.workshopCodes || [];
+    cameraId.value = data.cameraId || null;
+  };
+  const clearStore = () => {
+    ListType.value = 'all';
+    workshopCodes.value = [];
+    cameraId.value = null;
+  };
+
+  return { showQuestionList, ListType, workshopCodes, cameraId, openList, closeList, getState, setState, clearStore };
+});
+
+export default useQuestionListStore;

+ 78 - 26
src/views/institute-safety/modules/safety-question-list/QuestionList.vue

@@ -3,14 +3,14 @@
     <div class="abnormal-wrapper">
     <div class="abnormal-wrapper">
       <div class="title-pane">
       <div class="title-pane">
         <div class="title"><span>异常告警</span></div>
         <div class="title"><span>异常告警</span></div>
-        <img src="@/assets/images/video-grid/title-decoration.png" alt="" />
+        <img src="@/assets/images/institute-safety/title-decoration.png" alt="" />
         <el-icon class="close-icon" @click="handleClose"><Close /></el-icon>
         <el-icon class="close-icon" @click="handleClose"><Close /></el-icon>
       </div>
       </div>
       <div class="content-container">
       <div class="content-container">
         <div class="list-pane">
         <div class="list-pane">
-          <el-scrollbar class="list-scroll">
+          <el-scrollbar class="list-scroll" ref="scrollRef">
             <div
             <div
-              v-for="(it, idx) in items"
+              v-for="(it, idx) in requestRes"
               :key="it.id"
               :key="it.id"
               class="list-item"
               class="list-item"
               :class="{ active: idx === selectedIndex }"
               :class="{ active: idx === selectedIndex }"
@@ -34,7 +34,7 @@
                 </div>
                 </div>
               </div>
               </div>
             </div>
             </div>
-            <div v-if="!items.length" class="empty-tip">暂无数据</div>
+            <div v-if="!requestRes.length" class="empty-tip">暂无数据</div>
           </el-scrollbar>
           </el-scrollbar>
         </div>
         </div>
 
 
@@ -89,31 +89,70 @@
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
-  import { computed, onMounted, ref, watch } from 'vue';
+  import { computed, onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue';
   import { ElIcon, ElScrollbar } from 'element-plus';
   import { ElIcon, ElScrollbar } from 'element-plus';
   import { Close } from '@element-plus/icons-vue';
   import { Close } from '@element-plus/icons-vue';
   import { storeToRefs } from 'pinia';
   import { storeToRefs } from 'pinia';
   import urlJoin from 'url-join';
   import urlJoin from 'url-join';
   import { userSplitScreenFullScreen } from '@/store/modules/userSplitScreenFullScreen';
   import { userSplitScreenFullScreen } from '@/store/modules/userSplitScreenFullScreen';
+  import useQuestionListStore from '@/views/institute-safety/modules/safety-company-home/stores/use-question-list';
   import ImageViewer from './ImageViewer.vue';
   import ImageViewer from './ImageViewer.vue';
   import LiveVideo from '@/components/live/LiveVideoFlv.vue';
   import LiveVideo from '@/components/live/LiveVideoFlv.vue';
-  import { QueryTodayIssueListByWorkspaceRes, getTodayQuestionListApi } from '@/apis/splitScreenRetrieval';
-  import { getCameraInfoDetail } from '@/apis/camera/camera';
+  import { getCameraInfoDetail } from '@/api/camera/camera';
+  import type { IssueItem } from '@/views/institute-safety/modules/safety-company-home/types';
+  import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
+  import { getIssueListByCameraId, getIssueListByWorkshopCode } from '../safety-company-home/apis';
+  import { useInfiniteScroll } from '@vueuse/core';
 
 
   const { isFullScreen } = storeToRefs(userSplitScreenFullScreen());
   const { isFullScreen } = storeToRefs(userSplitScreenFullScreen());
   const { fullScreen, exitFullscreen } = userSplitScreenFullScreen();
   const { fullScreen, exitFullscreen } = userSplitScreenFullScreen();
 
 
-  const props = defineProps<{
-    id: number;
-  }>();
+  const questionListStore = useQuestionListStore();
+  const { getState, clearStore } = questionListStore;
+
+  const { type, workshopCodes, cameraId } = getState();
+  function getRequestParams() {
+    if (type === 'camera') {
+      return cameraId;
+    } else {
+      return { workshopCodeList: workshopCodes };
+    }
+  }
+
+  const DEFAULT_SIZE = 10;
+  const requestPage = ref(1);
+  const requestTotal = ref(0);
+
+  const scrollRef = useTemplateRef<HTMLElement>('scrollRef');
+  const { reset } = useInfiniteScroll(
+    scrollRef,
+    () => {
+      requestParams.value.pageNumber++;
+      load();
+    },
+    {
+      distance: 10,
+      canLoadMore: () => {
+        const noMoreContent = requestPage.value * DEFAULT_SIZE >= requestTotal.value;
+        if (noMoreContent) return false;
+        return true;
+      },
+    },
+  );
 
 
   const emits = defineEmits<{
   const emits = defineEmits<{
     (e: 'close'): void;
     (e: 'close'): void;
   }>();
   }>();
 
 
-  const items = ref<QueryTodayIssueListByWorkspaceRes[]>([]);
+  const requestRes = ref<IssueItem[]>([]);
+  const requestParams = ref<QueryPageRequest<{ workshopCodeList: string[] } | number>>({
+    pageNumber: requestPage.value,
+    pageSize: DEFAULT_SIZE,
+    queryParam: getRequestParams(),
+  } as QueryPageRequest<{ workshopCodeList: string[] } | number>);
+
   const selectedIndex = ref<number>(0);
   const selectedIndex = ref<number>(0);
-  const current = computed<QueryTodayIssueListByWorkspaceRes | undefined>(() => items.value[selectedIndex.value]);
+  const current = computed<IssueItem | undefined>(() => requestRes.value[selectedIndex.value]);
   const currentImageUrl = ref('');
   const currentImageUrl = ref('');
   const currentStreamIp = ref('');
   const currentStreamIp = ref('');
 
 
@@ -159,7 +198,18 @@
   };
   };
 
 
   const load = async (): Promise<void> => {
   const load = async (): Promise<void> => {
-    items.value = await getTodayQuestionListApi(props.id);
+    if (type === 'camera') {
+      const res = await getIssueListByCameraId(requestParams.value as QueryPageRequest<number>);
+      requestRes.value = res.records;
+      requestTotal.value = res.totalRow;
+    } else {
+      const res = await getIssueListByWorkshopCode(
+        requestParams.value as QueryPageRequest<{ workshopCodeList: string[] }>,
+      );
+      requestRes.value = res.records;
+      requestTotal.value = res.totalRow;
+    }
+
     selectedIndex.value = 0;
     selectedIndex.value = 0;
     activeTab.value = 'image';
     activeTab.value = 'image';
   };
   };
@@ -174,17 +224,13 @@
     },
     },
   );
   );
 
 
-  watch(
-    () => props.id,
-    () => {
-      load();
-    },
-    { immediate: false },
-  );
-
   onMounted(() => {
   onMounted(() => {
     load();
     load();
   });
   });
+
+  onUnmounted(() => {
+    clearStore();
+  });
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
@@ -195,11 +241,15 @@
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: center;
     justify-content: center;
+    position: absolute;
+    top: 0;
   }
   }
 
 
   .abnormal-wrapper {
   .abnormal-wrapper {
-    width: 78.5%;
-    height: 71.5%;
+    // width: 78.5%;
+    // height: 71.5%;
+    width: 100%;
+    height: 100%;
     padding: 15px 12px 12px 12px;
     padding: 15px 12px 12px 12px;
     background: rgba(0, 0, 0, 0.5);
     background: rgba(0, 0, 0, 0.5);
     backdrop-filter: blur(10px);
     backdrop-filter: blur(10px);
@@ -215,7 +265,7 @@
     .title {
     .title {
       width: 370px;
       width: 370px;
       height: 100%;
       height: 100%;
-      background: url(@/assets/icons/violation-title-bg.png) no-repeat;
+      background: url(@/assets/images/institute-safety/violation-title-bg.png) no-repeat;
       background-size: 100% 100%;
       background-size: 100% 100%;
       position: relative;
       position: relative;
 
 
@@ -233,6 +283,7 @@
     }
     }
 
 
     .close-icon {
     .close-icon {
+      color: #fff;
       font-size: 24px;
       font-size: 24px;
       margin-left: auto;
       margin-left: auto;
       cursor: pointer;
       cursor: pointer;
@@ -277,12 +328,12 @@
     }
     }
     .list-item:hover {
     .list-item:hover {
       transform: translateY(-1px);
       transform: translateY(-1px);
-      background-image: url('@/assets/images/video-grid/item-hover.png');
+      background-image: url('@/assets/images/institute-safety/item-hover.png');
       background-size: 100% 100%;
       background-size: 100% 100%;
       background-position: center;
       background-position: center;
     }
     }
     .list-item.active {
     .list-item.active {
-      background-image: url('@/assets/images/video-grid/item-active.png');
+      background-image: url('@/assets/images/institute-safety/item-active.png');
       background-size: 100% 100%;
       background-size: 100% 100%;
       background-position: center;
       background-position: center;
     }
     }
@@ -351,6 +402,7 @@
         line-height: 40px;
         line-height: 40px;
         cursor: pointer;
         cursor: pointer;
         margin-right: 2px;
         margin-right: 2px;
+        text-align: center;
       }
       }
 
 
       .tab:last-child {
       .tab:last-child {

+ 15 - 9
src/views/institute-safety/modules/safety-question-list/constant.ts

@@ -20,10 +20,10 @@ export enum QUESTION_TYPE_MAIN {
 }
 }
 
 
 export const questionMainTypeNameMap = {
 export const questionMainTypeNameMap = {
-  [QUESTION_TYPE_MAIN.fromHuman]: "人的不安全行为",
-  [QUESTION_TYPE_MAIN.fromThing]: "物的不安全状态",
-  [QUESTION_TYPE_MAIN.fromEnvir]: "环境的不安全因素",
-  [QUESTION_TYPE_MAIN.fromManage]: "管理措施的不规范",
+  [QUESTION_TYPE_MAIN.fromHuman]: '人的不安全行为',
+  [QUESTION_TYPE_MAIN.fromThing]: '物的不安全状态',
+  [QUESTION_TYPE_MAIN.fromEnvir]: '环境的不安全因素',
+  [QUESTION_TYPE_MAIN.fromManage]: '管理措施的不规范',
 };
 };
 
 
 export enum QUESTION_SEVERITY {
 export enum QUESTION_SEVERITY {
@@ -33,9 +33,9 @@ export enum QUESTION_SEVERITY {
 }
 }
 
 
 export const questionSeverityNameMap = {
 export const questionSeverityNameMap = {
-  [QUESTION_SEVERITY.slight]: "轻微",
-  [QUESTION_SEVERITY.general]: "一般",
-  [QUESTION_SEVERITY.serious]: "严重",
+  [QUESTION_SEVERITY.slight]: '轻微',
+  [QUESTION_SEVERITY.general]: '一般',
+  [QUESTION_SEVERITY.serious]: '严重',
 };
 };
 
 
 // 问题处理状态:正常,超期未处理、长期未处理
 // 问题处理状态:正常,超期未处理、长期未处理
@@ -46,6 +46,12 @@ export enum IssueProcessState {
 }
 }
 
 
 export const IssueProcessStateName = {
 export const IssueProcessStateName = {
-  [IssueProcessState.OVERDUE]: "超期未处理",
-  [IssueProcessState.LONGTIME]: "长期未处理",
+  [IssueProcessState.OVERDUE]: '超期未处理',
+  [IssueProcessState.LONGTIME]: '长期未处理',
 } as const;
 } as const;
+
+// export const ISSUELIST_REQUEST_MAP = {
+//   all: getIssueListByWorkshopCode,
+//   workshop: getIssueListByWorkshopCode,
+//   camera: getIssueListByCameraId,
+// };

+ 29 - 238
src/views/institute-safety/modules/safety-workshop-list/WorkshopList.vue

@@ -5,252 +5,42 @@
       <el-tooltip placement="top" :content="item.name">
       <el-tooltip placement="top" :content="item.name">
         <div class="workshop-list-item-name">{{ item.name }}</div>
         <div class="workshop-list-item-name">{{ item.name }}</div>
       </el-tooltip>
       </el-tooltip>
-      <img class="workshop-list-item-icon" v-if="item.status" src="@/assets/images/institute-safety/alert.png" alt="" />
+      <img
+        class="workshop-list-item-icon"
+        v-if="!item.status"
+        src="@/assets/images/institute-safety/alert.png"
+        alt=""
+        @click="handleOpenQuestionList(item.workshopCode)"
+      />
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
-  import { onMounted, ref } from 'vue';
+  import { nextTick, onMounted, ref } from 'vue';
   import { ElTooltip } from 'element-plus';
   import { ElTooltip } from 'element-plus';
   import { getWorkshopTodayExceptionStatus } from './apis';
   import { getWorkshopTodayExceptionStatus } from './apis';
+  import { WORKSHOP_INFOS } from './constants';
 
 
-  const staticWorkshopList = ref([
-    {
-      id: 1,
-      status: false,
-      workshopCode: 'R&DBuilding',
-      name: '设计研发大楼',
-    },
-    {
-      id: 2,
-      status: false,
-      workshopCode: 'ITCenter',
-      name: '信息中心',
-    },
-    {
-      id: 3,
-      status: false,
-      workshopCode: 'ArchivesCenter',
-      name: '档案中心',
-    },
-    {
-      id: 4,
-      status: false,
-      workshopCode: 'Canteen',
-      name: '职工食堂1',
-    },
-    {
-      id: 5,
-      status: false,
-      workshopCode: 'GeneralManagementBuilding',
-      name: '综合楼',
-    },
-    {
-      id: 6,
-      status: false,
-      workshopCode: 'ExecutiveBuilding',
-      name: '行政办公楼',
-    },
-    {
-      id: 7,
-      status: false,
-      workshopCode: 'ChiefDesignerBuilding',
-      name: '总师楼',
-    },
-    {
-      id: 8,
-      status: false,
-      workshopCode: 'CustomizationCenter&MultifunctionalPrototypeHangar',
-      name: '客户选型中心及多功能样机库',
-    },
-    {
-      id: 9,
-      status: false,
-      workshopCode: 'MiniCanteen',
-      name: '职工食堂2',
-    },
-    {
-      id: 10,
-      status: false,
-      workshopCode: 'C919SystemIntegrationLab',
-      name: 'C919系统综合实验室',
-    },
-    {
-      id: 11,
-      status: false,
-      workshopCode: '35VElectricityTransformerStation',
-      name: '35KV变电站',
-    },
-    {
-      id: 12,
-      status: false,
-      workshopCode: 'StressLab',
-      name: '强度试验室',
-    },
-    {
-      id: 13,
-      status: false,
-      workshopCode: 'GarbageStation',
-      name: '垃圾房',
-    },
-    {
-      id: 14,
-      status: false,
-      workshopCode: 'ElectricityDistributionStation3',
-      name: '配电站3',
-    },
-    {
-      id: 15,
-      status: false,
-      workshopCode: 'StructuralFunctionLab',
-      name: '机构功能试验室',
-    },
-    {
-      id: 16,
-      status: false,
-      workshopCode: 'EnvironmentalControlSystemLab',
-      name: '环控试验室',
-    },
-    {
-      id: 17,
-      status: false,
-      workshopCode: 'AirCompressionStation',
-      name: '空压站',
-    },
-    {
-      id: 18,
-      status: false,
-      workshopCode: 'FuelSystemLab',
-      name: '燃油试验室',
-    },
-    {
-      id: 19,
-      status: false,
-      workshopCode: 'FireProtectionSystemLab',
-      name: '防火试验室',
-    },
-    {
-      id: 20,
-      status: false,
-      workshopCode: 'KerodanePumpingStation',
-      name: '煤油泵站',
-    },
-    {
-      id: 21,
-      status: false,
-      workshopCode: 'StaffResidence',
-      name: '单身公寓',
-    },
-    {
-      id: 22,
-      status: false,
-      workshopCode: 'StaffActivityCenter',
-      name: '职工活动中心',
-    },
-    {
-      id: 23,
-      status: false,
-      workshopCode: 'TechnologyInnovationBuilding',
-      name: '科技创新楼',
-    },
-    {
-      id: 24,
-      status: false,
-      workshopCode: 'LogisticsManagementCenter',
-      name: '综合保障管理中心',
-    },
-    {
-      id: 25,
-      status: false,
-      workshopCode: 'E3Lab',
-      name: '电磁环境效应试验室',
-    },
-    {
-      id: 26,
-      status: false,
-      workshopCode: 'ElectricityDistributionStation1',
-      name: '配电站1',
-    },
-    {
-      id: 27,
-      status: false,
-      workshopCode: 'ElectricityDistributionStation2',
-      name: '配电站2',
-    },
-    {
-      id: 28,
-      status: false,
-      workshopCode: 'Library',
-      name: '阅览中心',
-    },
-    {
-      id: 29,
-      status: false,
-      workshopCode: 'RegionalJetSystemIntegrationLab',
-      name: '支线客机系统综合试验室',
-    },
-    {
-      id: 30,
-      status: false,
-      workshopCode: 'FlightControlSystemLab',
-      name: '飞控系统试验室',
-    },
-    {
-      id: 31,
-      status: false,
-      workshopCode: 'AvionicSystemLab',
-      name: '航电系统试验室',
-    },
-    {
-      id: 32,
-      status: false,
-      workshopCode: 'ElectricalSystemLab',
-      name: '电气系统试验室',
-    },
-    {
-      id: 33,
-      status: false,
-      workshopCode: 'CR929SystemIntegrationLab',
-      name: 'CR929系统综合试验室',
-    },
-    {
-      id: 34,
-      status: false,
-      workshopCode: 'AircraftIntegrationLab',
-      name: '总体集成试验室',
-    },
-    {
-      id: 35,
-      status: false,
-      workshopCode: 'DigitalSimulationLab',
-      name: '数字仿真试验室',
-    },
-    {
-      id: 36,
-      status: false,
-      workshopCode: 'AdvancedMaterialLab',
-      name: '先进材料试验室',
-    },
-    {
-      id: 37,
-      status: false,
-      workshopCode: 'ProgramDevelopmentCenter',
-      name: '型号发展中心',
-    },
-    {
-      id: 38,
-      status: false,
-      workshopCode: 'StructuralIntegrationLab',
-      name: '结构综合试验室',
-    },
-    {
-      id: 39,
-      status: false,
-      workshopCode: 'FundamentalTechnologyLab',
-      name: '基础技术试验室',
-    },
-  ]);
+  import useQuestionListStore from '@/views/institute-safety/modules/safety-company-home/stores/use-question-list';
+  import { storeToRefs } from 'pinia';
+
+  const questionListStore = useQuestionListStore();
+  const { showQuestionList } = storeToRefs(questionListStore);
+
+  const staticWorkshopList = ref(WORKSHOP_INFOS);
+
+  function handleOpenQuestionList(code: string) {
+    questionListStore.closeList();
+    questionListStore.clearStore();
+    nextTick(() => {
+      questionListStore.setState({
+        type: 'workshop',
+        workshopCodes: [code],
+      });
+      questionListStore.openList();
+    });
+  }
 
 
   onMounted(() => {
   onMounted(() => {
     getWorkshopTodayExceptionStatus(staticWorkshopList.value.map((item) => item.workshopCode)).then((res) => {
     getWorkshopTodayExceptionStatus(staticWorkshopList.value.map((item) => item.workshopCode)).then((res) => {
@@ -304,6 +94,7 @@
     text-overflow: ellipsis;
     text-overflow: ellipsis;
   }
   }
   .workshop-list-item-icon {
   .workshop-list-item-icon {
+    cursor: pointer;
     margin-left: 10px;
     margin-left: 10px;
     width: 20px;
     width: 20px;
     height: 20px;
     height: 20px;

+ 236 - 0
src/views/institute-safety/modules/safety-workshop-list/constants.ts

@@ -0,0 +1,236 @@
+export const WORKSHOP_INFOS = [
+  {
+    id: 1,
+    status: false,
+    workshopCode: 'R&DBuilding',
+    name: '设计研发大楼',
+  },
+  {
+    id: 2,
+    status: false,
+    workshopCode: 'ITCenter',
+    name: '信息中心',
+  },
+  {
+    id: 3,
+    status: false,
+    workshopCode: 'ArchivesCenter',
+    name: '档案中心',
+  },
+  {
+    id: 4,
+    status: false,
+    workshopCode: 'Canteen',
+    name: '职工食堂1',
+  },
+  {
+    id: 5,
+    status: false,
+    workshopCode: 'GeneralManagementBuilding',
+    name: '综合楼',
+  },
+  {
+    id: 6,
+    status: false,
+    workshopCode: 'ExecutiveBuilding',
+    name: '行政办公楼',
+  },
+  {
+    id: 7,
+    status: false,
+    workshopCode: 'ChiefDesignerBuilding',
+    name: '总师楼',
+  },
+  {
+    id: 8,
+    status: false,
+    workshopCode: 'CustomizationCenter&MultifunctionalPrototypeHangar',
+    name: '客户选型中心及多功能样机库',
+  },
+  {
+    id: 9,
+    status: false,
+    workshopCode: 'MiniCanteen',
+    name: '职工食堂2',
+  },
+  {
+    id: 10,
+    status: false,
+    workshopCode: 'C919SystemIntegrationLab',
+    name: 'C919系统综合实验室',
+  },
+  {
+    id: 11,
+    status: false,
+    workshopCode: '35VElectricityTransformerStation',
+    name: '35KV变电站',
+  },
+  {
+    id: 12,
+    status: false,
+    workshopCode: 'StressLab',
+    name: '强度试验室',
+  },
+  {
+    id: 13,
+    status: false,
+    workshopCode: 'GarbageStation',
+    name: '垃圾房',
+  },
+  {
+    id: 14,
+    status: false,
+    workshopCode: 'ElectricityDistributionStation3',
+    name: '配电站3',
+  },
+  {
+    id: 15,
+    status: false,
+    workshopCode: 'StructuralFunctionLab',
+    name: '机构功能试验室',
+  },
+  {
+    id: 16,
+    status: false,
+    workshopCode: 'EnvironmentalControlSystemLab',
+    name: '环控试验室',
+  },
+  {
+    id: 17,
+    status: false,
+    workshopCode: 'AirCompressionStation',
+    name: '空压站',
+  },
+  {
+    id: 18,
+    status: false,
+    workshopCode: 'FuelSystemLab',
+    name: '燃油试验室',
+  },
+  {
+    id: 19,
+    status: false,
+    workshopCode: 'FireProtectionSystemLab',
+    name: '防火试验室',
+  },
+  {
+    id: 20,
+    status: false,
+    workshopCode: 'KerodanePumpingStation',
+    name: '煤油泵站',
+  },
+  {
+    id: 21,
+    status: false,
+    workshopCode: 'StaffResidence',
+    name: '单身公寓',
+  },
+  {
+    id: 22,
+    status: false,
+    workshopCode: 'StaffActivityCenter',
+    name: '职工活动中心',
+  },
+  {
+    id: 23,
+    status: false,
+    workshopCode: 'TechnologyInnovationBuilding',
+    name: '科技创新楼',
+  },
+  {
+    id: 24,
+    status: false,
+    workshopCode: 'LogisticsManagementCenter',
+    name: '综合保障管理中心',
+  },
+  {
+    id: 25,
+    status: false,
+    workshopCode: 'E3Lab',
+    name: '电磁环境效应试验室',
+  },
+  {
+    id: 26,
+    status: false,
+    workshopCode: 'ElectricityDistributionStation1',
+    name: '配电站1',
+  },
+  {
+    id: 27,
+    status: false,
+    workshopCode: 'ElectricityDistributionStation2',
+    name: '配电站2',
+  },
+  {
+    id: 28,
+    status: false,
+    workshopCode: 'Library',
+    name: '阅览中心',
+  },
+  {
+    id: 29,
+    status: false,
+    workshopCode: 'RegionalJetSystemIntegrationLab',
+    name: '支线客机系统综合试验室',
+  },
+  {
+    id: 30,
+    status: false,
+    workshopCode: 'FlightControlSystemLab',
+    name: '飞控系统试验室',
+  },
+  {
+    id: 31,
+    status: false,
+    workshopCode: 'AvionicSystemLab',
+    name: '航电系统试验室',
+  },
+  {
+    id: 32,
+    status: false,
+    workshopCode: 'ElectricalSystemLab',
+    name: '电气系统试验室',
+  },
+  {
+    id: 33,
+    status: false,
+    workshopCode: 'CR929SystemIntegrationLab',
+    name: 'CR929系统综合试验室',
+  },
+  {
+    id: 34,
+    status: false,
+    workshopCode: 'AircraftIntegrationLab',
+    name: '总体集成试验室',
+  },
+  {
+    id: 35,
+    status: false,
+    workshopCode: 'DigitalSimulationLab',
+    name: '数字仿真试验室',
+  },
+  {
+    id: 36,
+    status: false,
+    workshopCode: 'AdvancedMaterialLab',
+    name: '先进材料试验室',
+  },
+  {
+    id: 37,
+    status: false,
+    workshopCode: 'ProgramDevelopmentCenter',
+    name: '型号发展中心',
+  },
+  {
+    id: 38,
+    status: false,
+    workshopCode: 'StructuralIntegrationLab',
+    name: '结构综合试验室',
+  },
+  {
+    id: 39,
+    status: false,
+    workshopCode: 'FundamentalTechnologyLab',
+    name: '基础技术试验室',
+  },
+];