|
|
@@ -0,0 +1,150 @@
|
|
|
+<template>
|
|
|
+ <div class="workshop-list">
|
|
|
+ <header class="list-header">
|
|
|
+ <div style="width: 16px"></div>
|
|
|
+ <span> 监控区域列表 </span>
|
|
|
+ <img class="close-btn" src="@/assets/images/institute-safety/close.png" alt="" @click="emits('close')" />
|
|
|
+ </header>
|
|
|
+ <main class="workshop-list-main">
|
|
|
+ <div class="workshop-item" v-for="item in staticWorkshopList" :key="item.id">
|
|
|
+ <span class="item-id">{{ item.id }}</span>
|
|
|
+
|
|
|
+ <el-tooltip placement="top" :content="item.name" :hide-after="0">
|
|
|
+ <span class="item-name"> {{ item.name }} </span>
|
|
|
+ </el-tooltip>
|
|
|
+ <img
|
|
|
+ class="item-icon"
|
|
|
+ v-if="item.status"
|
|
|
+ src="@/assets/images/institute-safety/alert.png"
|
|
|
+ alt=""
|
|
|
+ @click="handleOpenQuestionList(item.workshopCode)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+ import { nextTick, onMounted, ref } from 'vue';
|
|
|
+ import { ElTooltip } from 'element-plus';
|
|
|
+ import { getWorkshopTodayExceptionStatus } from '../apis';
|
|
|
+ import { WORKSHOP_INFOS } from '../constants';
|
|
|
+
|
|
|
+ import useQuestionListStore from '@/views/institute-safety/modules/safety-company-home/stores/use-question-list';
|
|
|
+
|
|
|
+ const emits = defineEmits<{
|
|
|
+ (e: 'close'): void;
|
|
|
+ }>();
|
|
|
+
|
|
|
+ const questionListStore = useQuestionListStore();
|
|
|
+
|
|
|
+ const staticWorkshopList = ref(WORKSHOP_INFOS);
|
|
|
+
|
|
|
+ function handleOpenQuestionList(code: string) {
|
|
|
+ questionListStore.closeList();
|
|
|
+ questionListStore.clearStore();
|
|
|
+ nextTick(() => {
|
|
|
+ questionListStore.setState({
|
|
|
+ type: 'workshop',
|
|
|
+ workshopCodes: [code],
|
|
|
+ });
|
|
|
+ questionListStore.openList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ getWorkshopTodayExceptionStatus(staticWorkshopList.value.map((item) => item.workshopCode)).then((res) => {
|
|
|
+ staticWorkshopList.value.forEach((item) => {
|
|
|
+ item.status = res.find((x) => x.workshopCode === item.workshopCode)!.exceptionStatus;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .workshop-list {
|
|
|
+ width: 280px;
|
|
|
+ height: 675px;
|
|
|
+
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ right: 0px;
|
|
|
+
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ border-radius: 12px 4px 4px 12px;
|
|
|
+ backdrop-filter: blur(10px);
|
|
|
+ }
|
|
|
+
|
|
|
+ .list-header {
|
|
|
+ margin: 12px 0;
|
|
|
+ padding: 0 16px;
|
|
|
+
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #ffffff;
|
|
|
+
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ .config-btn,
|
|
|
+ .close-btn {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .workshop-list-main {
|
|
|
+ padding: 0 16px;
|
|
|
+ height: 623px;
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .workshop-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ .item-id {
|
|
|
+ font-family: DIN, DIN;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #ffffff;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ background: rgba(0, 0, 0, 0.4);
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-name {
|
|
|
+ margin-left: 8px;
|
|
|
+ max-width: 183px;
|
|
|
+ height: 28px;
|
|
|
+ line-height: 28px;
|
|
|
+ border-radius: 4px;
|
|
|
+
|
|
|
+ padding: 0 10px;
|
|
|
+
|
|
|
+ white-space: nowrap; /* 防止文本换行 */
|
|
|
+ overflow: hidden; /* 隐藏溢出的文本 */
|
|
|
+ text-overflow: ellipsis; /* 显示省略号 */
|
|
|
+
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-icon {
|
|
|
+ margin-right: 8px;
|
|
|
+ margin-left: auto;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .camera-name-text {
|
|
|
+ max-width: 200px;
|
|
|
+ white-space: nowrap; /* 防止文本换行 */
|
|
|
+ overflow: hidden; /* 隐藏溢出的文本 */
|
|
|
+ text-overflow: ellipsis; /* 显示省略号 */
|
|
|
+ }
|
|
|
+</style>
|