c039acfe6909d5cfb0b14d17a995b0b49df86eccad80ba0e66b72805e6bebbbc.json 6.0 KB

1
  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 levelText(level) {\n const map = {\n high: '高',\n medium: '中',\n low: '低'\n };\n return map[level] || level;\n },\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","levelText","level","map","high","medium","low","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\" ref=\"listScroll\">\n <div\n v-for=\"item in list\"\n :key=\"item.id\"\n class=\"inspection-item\"\n >\n <div class=\"item-index\">{{ item.id }}</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-level\" :class=\"'level-' + item.level\">\n {{ levelText(item.level) }}\n </div>\n <div class=\"item-status\" :class=\"'status-' + 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 levelText(level) {\n const map = { high: '高', medium: '中', low: '低' }\n return map[level] || level\n },\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\n.total-badge {\n margin-left: 8px;\n font-size: 12px;\n background: $accent-blue;\n color: #fff;\n padding: 2px 8px;\n border-radius: 10px;\n font-weight: normal;\n}\n\n.panel-content {\n flex: 1;\n overflow: hidden;\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: 10px 0;\n border-bottom: 1px solid rgba(26, 58, 106, 0.3);\n font-size: 13px;\n gap: 10px;\n}\n\n.item-index {\n width: 24px;\n height: 24px;\n line-height: 24px;\n text-align: center;\n background: rgba(33, 150, 243, 0.2);\n border-radius: 4px;\n color: $accent-blue;\n font-size: 12px;\n flex-shrink: 0;\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-level {\n width: 32px;\n text-align: center;\n font-size: 12px;\n padding: 2px 0;\n border-radius: 2px;\n flex-shrink: 0;\n\n &.level-high {\n color: #f44336;\n background: rgba(244, 67, 54, 0.15);\n }\n &.level-medium {\n color: #ff9800;\n background: rgba(255, 152, 0, 0.15);\n }\n &.level-low {\n color: #4caf50;\n background: rgba(76, 175, 80, 0.15);\n }\n}\n\n.item-status {\n font-size: 12px;\n flex-shrink: 0;\n\n &.status-待整改 { color: #f44336; }\n &.status-整改中 { color: #ff9800; }\n &.status-已整改 { color: #4caf50; }\n}\n\n.item-date {\n color: $text-muted;\n font-size: 11px;\n flex-shrink: 0;\n}\n</style>\n"],"mappings":"AAkCA,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,KAAA;MACA,MAAAC,GAAA;QAAAC,IAAA;QAAAC,MAAA;QAAAC,GAAA;MAAA;MACA,OAAAH,GAAA,CAAAD,KAAA,KAAAA,KAAA;IACA;IACA;IACAL,YAAA;MACA,MAAAU,OAAA,QAAAC,KAAA,CAAAC,WAAA;MACA,KAAAF,OAAA;MACA,KAAAd,WAAA,GAAAiB,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":[]}