| 1 |
- {"ast":null,"code":"import { getInspectionList } from '@/api';\nexport default {\n name: 'InspectionList',\n data() {\n return {\n total: 0,\n list: [],\n scrollTimer: null\n };\n },\n async mounted() {\n const res = await getInspectionList();\n this.total = res.data.total;\n this.list = res.data.list;\n this.$nextTick(() => this.startScroll());\n },\n beforeDestroy() {\n clearInterval(this.scrollTimer);\n },\n methods: {\n statusKey(status) {\n const map = {\n '待整改': 'pending',\n '整改中': 'doing',\n '已整改': 'done'\n };\n return map[status] || 'pending';\n },\n startScroll() {\n const wrapper = this.$refs.listWrapper;\n if (!wrapper) return;\n this.scrollTimer = setInterval(() => {\n if (wrapper.scrollTop + wrapper.clientHeight >= wrapper.scrollHeight - 2) {\n wrapper.scrollTop = 0;\n } else {\n wrapper.scrollTop += 1;\n }\n }, 50);\n }\n }\n};","map":{"version":3,"names":["getInspectionList","name","data","total","list","scrollTimer","mounted","res","$nextTick","startScroll","beforeDestroy","clearInterval","methods","statusKey","status","map","wrapper","$refs","listWrapper","setInterval","scrollTop","clientHeight","scrollHeight"],"sources":["src/components/LabStats/InspectionList.vue"],"sourcesContent":["<template>\n <div class=\"panel-box inspection-list\">\n <div class=\"panel-title\">\n 实验室安全检查情况\n <span class=\"total-badge\">{{ total }}</span>\n </div>\n <div class=\"panel-content\">\n <div class=\"list-wrapper\" ref=\"listWrapper\">\n <div class=\"list-scroll\">\n <div\n v-for=\"item in list\"\n :key=\"item.id\"\n class=\"inspection-item\"\n >\n <div class=\"item-dot\" :class=\"'dot-' + item.level\"></div>\n <div class=\"item-info\">\n <div class=\"item-lab\">{{ item.lab }}</div>\n <div class=\"item-issue\">{{ item.issue }}</div>\n </div>\n <div class=\"item-status\" :class=\"'status-' + statusKey(item.status)\">\n {{ item.status }}\n </div>\n <div class=\"item-date\">{{ item.date }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { getInspectionList } from '@/api'\n\nexport default {\n name: 'InspectionList',\n data() {\n return {\n total: 0,\n list: [],\n scrollTimer: null\n }\n },\n async mounted() {\n const res = await getInspectionList()\n this.total = res.data.total\n this.list = res.data.list\n this.$nextTick(() => this.startScroll())\n },\n beforeDestroy() {\n clearInterval(this.scrollTimer)\n },\n methods: {\n statusKey(status) {\n const map = { '待整改': 'pending', '整改中': 'doing', '已整改': 'done' }\n return map[status] || 'pending'\n },\n startScroll() {\n const wrapper = this.$refs.listWrapper\n if (!wrapper) return\n this.scrollTimer = setInterval(() => {\n if (wrapper.scrollTop + wrapper.clientHeight >= wrapper.scrollHeight - 2) {\n wrapper.scrollTop = 0\n } else {\n wrapper.scrollTop += 1\n }\n }, 50)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.inspection-list {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .panel-content {\n flex: 1;\n overflow: hidden;\n padding: 8px 16px;\n }\n}\n\n.total-badge {\n margin-left: 8px;\n font-size: 13px;\n background: rgba(33, 150, 243, 0.2);\n color: $accent-cyan;\n padding: 2px 10px;\n border-radius: 10px;\n font-weight: normal;\n border: 1px solid rgba(33, 150, 243, 0.3);\n}\n\n.list-wrapper {\n height: 100%;\n overflow: hidden;\n}\n\n.inspection-item {\n display: flex;\n align-items: center;\n padding: 9px 0;\n border-bottom: 1px solid rgba(26, 58, 106, 0.25);\n font-size: 13px;\n gap: 10px;\n}\n\n.item-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n flex-shrink: 0;\n\n &.dot-high { background: #f44336; box-shadow: 0 0 6px rgba(244,67,54,0.5); }\n &.dot-medium { background: #ff9800; box-shadow: 0 0 6px rgba(255,152,0,0.5); }\n &.dot-low { background: #4caf50; box-shadow: 0 0 6px rgba(76,175,80,0.5); }\n}\n\n.item-info {\n flex: 1;\n min-width: 0;\n\n .item-lab {\n color: #fff;\n font-size: 13px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .item-issue {\n color: $text-muted;\n font-size: 11px;\n margin-top: 2px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n}\n\n.item-status {\n font-size: 12px;\n flex-shrink: 0;\n padding: 2px 8px;\n border-radius: 2px;\n\n &.status-pending {\n color: #f44336;\n background: rgba(244, 67, 54, 0.12);\n }\n &.status-doing {\n color: #ff9800;\n background: rgba(255, 152, 0, 0.12);\n }\n &.status-done {\n color: #4caf50;\n background: rgba(76, 175, 80, 0.12);\n }\n}\n\n.item-date {\n color: $text-muted;\n font-size: 11px;\n flex-shrink: 0;\n white-space: nowrap;\n}\n</style>\n"],"mappings":"AA+BA,SAAAA,iBAAA;AAEA;EACAC,IAAA;EACAC,KAAA;IACA;MACAC,KAAA;MACAC,IAAA;MACAC,WAAA;IACA;EACA;EACA,MAAAC,QAAA;IACA,MAAAC,GAAA,SAAAP,iBAAA;IACA,KAAAG,KAAA,GAAAI,GAAA,CAAAL,IAAA,CAAAC,KAAA;IACA,KAAAC,IAAA,GAAAG,GAAA,CAAAL,IAAA,CAAAE,IAAA;IACA,KAAAI,SAAA,YAAAC,WAAA;EACA;EACAC,cAAA;IACAC,aAAA,MAAAN,WAAA;EACA;EACAO,OAAA;IACAC,UAAAC,MAAA;MACA,MAAAC,GAAA;QAAA;QAAA;QAAA;MAAA;MACA,OAAAA,GAAA,CAAAD,MAAA;IACA;IACAL,YAAA;MACA,MAAAO,OAAA,QAAAC,KAAA,CAAAC,WAAA;MACA,KAAAF,OAAA;MACA,KAAAX,WAAA,GAAAc,WAAA;QACA,IAAAH,OAAA,CAAAI,SAAA,GAAAJ,OAAA,CAAAK,YAAA,IAAAL,OAAA,CAAAM,YAAA;UACAN,OAAA,CAAAI,SAAA;QACA;UACAJ,OAAA,CAAAI,SAAA;QACA;MACA;IACA;EACA;AACA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|